@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap");

:root {
  --bg: #06131c;
  --bg-elevated: #0f2532;
  --panel: rgba(13, 35, 46, 0.86);
  --panel-stroke: rgba(137, 201, 179, 0.24);
  --text: #edf6f4;
  --muted: #9dbeb4;
  --accent: #4de8ba;
  --accent-soft: #1d7f69;
  --danger: #f27f6a;
  --shadow: 0 20px 45px rgba(2, 10, 16, 0.45);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: "Space Grotesk", "Avenir Next", "Segoe UI", sans-serif;
}

body.dialog-open {
  overflow: hidden;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.kicker {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  color: var(--muted);
}

.btn {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.7rem 1.15rem;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, opacity 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(120deg, #4de8ba, #52c6ef);
  color: #04232b;
  border-color: rgba(255, 255, 255, 0.18);
}

.btn-secondary {
  background: rgba(12, 28, 35, 0.8);
  border-color: rgba(164, 216, 198, 0.32);
  color: var(--text);
}

.landing-page {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}

.aurora {
  position: absolute;
  inset: -30% -15% auto;
  height: 70vh;
  background:
    radial-gradient(circle at 30% 35%, rgba(77, 232, 186, 0.3), transparent 45%),
    radial-gradient(circle at 75% 20%, rgba(82, 198, 239, 0.24), transparent 45%),
    radial-gradient(circle at 48% 78%, rgba(74, 112, 238, 0.18), transparent 52%);
  filter: blur(10px);
  animation: drift 10s ease-in-out infinite alternate;
}

.landing-shell {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem;
}

.hero-card {
  width: min(680px, 100%);
  background: linear-gradient(165deg, rgba(16, 39, 52, 0.96), rgba(8, 25, 35, 0.92));
  border: 1px solid rgba(157, 221, 201, 0.35);
  box-shadow: var(--shadow);
  border-radius: 26px;
  padding: 2.2rem;
  display: grid;
  gap: 1rem;
  animation: rise 0.6s ease;
}

.hero-card h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
}

.hero-card p {
  color: var(--muted);
  line-height: 1.5;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  padding-top: 0.4rem;
}

.app-page {
  min-height: 100vh;
  position: relative;
  padding: 1.4rem;
}

.app-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 10% 8%, rgba(77, 232, 186, 0.16), transparent 36%),
    radial-gradient(circle at 85% 20%, rgba(82, 198, 239, 0.18), transparent 33%),
    linear-gradient(175deg, #06131c, #0b1f29 40%, #08161f 100%);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1rem;
}

.topbar h1 {
  font-size: clamp(1.6rem, 3.2vw, 2.2rem);
}

.page-tabs {
  margin-top: 0.65rem;
  display: inline-flex;
  gap: 0.35rem;
  padding: 0.3rem;
  border-radius: 999px;
  border: 1px solid rgba(144, 211, 189, 0.26);
  background: rgba(8, 28, 37, 0.72);
}

.page-tab {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.82rem;
  padding: 0.34rem 0.72rem;
  border-radius: 999px;
  border: 1px solid transparent;
}

.page-tab:hover {
  color: var(--text);
  border-color: rgba(147, 207, 187, 0.24);
}

.page-tab-active {
  color: #062029;
  background: linear-gradient(120deg, #4de8ba, #52c6ef);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.user-badge {
  font-size: 0.85rem;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  background: rgba(10, 34, 45, 0.72);
  border: 1px solid rgba(127, 193, 171, 0.3);
  color: var(--text);
}

.user-badge-btn {
  font-family: "Space Grotesk", sans-serif;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.user-badge-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(156, 220, 199, 0.5);
}

.workspace {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1.1fr 1.3fr 1.4fr;
}

.workspace-review {
  grid-template-columns: 1.25fr 1.45fr;
}

.admin-workspace {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr 1.8fr;
}

.submit-workspace {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1.35fr 1fr;
}

.my-submissions-panel {
  grid-column: 1 / -1;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-stroke);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 1rem;
  display: grid;
  align-content: start;
  gap: 0.8rem;
  min-height: 220px;
}

.panel h2 {
  font-size: 1.1rem;
}

.panel-note {
  font-size: 0.84rem;
  color: var(--muted);
}

.hidden {
  display: none !important;
}

.stack-form {
  display: grid;
  gap: 0.55rem;
  background: rgba(7, 23, 30, 0.54);
  border: 1px solid rgba(151, 216, 196, 0.2);
  border-radius: 14px;
  padding: 0.9rem;
}

.stack-form h3 {
  font-size: 0.92rem;
}

.submission-launcher .btn {
  justify-self: start;
}

.submit-dialog {
  width: min(980px, 94vw);
  max-height: 90vh;
  padding: 0;
  border: 1px solid rgba(145, 214, 191, 0.34);
  border-radius: 18px;
  background: rgba(9, 28, 37, 0.95);
  color: var(--text);
  box-shadow: var(--shadow);
}

.submit-dialog::backdrop {
  background: rgba(4, 11, 16, 0.72);
  backdrop-filter: blur(3px);
}

.submit-dialog-shell {
  display: grid;
  gap: 0.8rem;
  padding: 1rem;
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: visible;
}

.submit-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.submit-dialog-head h2 {
  font-size: 1.1rem;
}

.inline-dialog-message {
  margin: 0;
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
  font-size: 0.82rem;
  background: rgba(9, 27, 36, 0.82);
  border: 1px solid rgba(116, 189, 165, 0.38);
  opacity: 0;
  transform: translateY(2px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.inline-dialog-message.visible {
  opacity: 1;
  transform: translateY(0);
}

.inline-dialog-message.error {
  border-color: rgba(242, 127, 106, 0.55);
  color: #ffd5cc;
}

.submit-flow-options {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.flow-option {
  border: 1px solid rgba(131, 201, 178, 0.35);
  border-radius: 999px;
  background: rgba(8, 26, 34, 0.75);
  color: var(--text);
  cursor: pointer;
  padding: 0.45rem 0.8rem;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.85rem;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.flow-option:hover {
  transform: translateY(-1px);
  border-color: rgba(154, 223, 198, 0.6);
}

.flow-option-active {
  background: linear-gradient(120deg, rgba(77, 232, 186, 0.3), rgba(82, 198, 239, 0.26));
  border-color: rgba(159, 228, 204, 0.78);
}

.submit-flow-panel {
  display: grid;
  gap: 0.6rem;
}

.submit-contribute-tabs {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

input,
textarea,
select {
  width: 100%;
  background: rgba(4, 18, 24, 0.75);
  border: 1px solid rgba(132, 190, 171, 0.36);
  color: var(--text);
  border-radius: 10px;
  padding: 0.65rem 0.7rem;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.9rem;
}

textarea {
  resize: vertical;
  min-height: 78px;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(77, 232, 186, 0.2);
}

.landscape-list {
  display: grid;
  gap: 0.7rem;
  max-height: 68vh;
  overflow: auto;
  padding-right: 0.25rem;
}

.browser-toolbar {
  display: grid;
  gap: 0.45rem;
}

.browser-filter {
  width: 100%;
}

.category-accordion {
  border: 1px solid rgba(152, 216, 197, 0.26);
  border-radius: 14px;
  background: rgba(6, 21, 29, 0.58);
  overflow: hidden;
}

.category-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  cursor: pointer;
  padding: 0.75rem;
}

.category-summary::-webkit-details-marker {
  display: none;
}

.category-summary-title {
  font-size: 0.96rem;
  font-weight: 600;
}

.category-accordion-body {
  border-top: 1px solid rgba(132, 196, 174, 0.2);
  padding: 0.7rem 0.75rem;
  display: grid;
  gap: 0.55rem;
}

.category-summary-note {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0;
}

.family-list {
  display: grid;
  gap: 0.4rem;
}

.family-list-item {
  width: 100%;
  border: 1px solid rgba(126, 194, 172, 0.26);
  border-radius: 12px;
  background: rgba(8, 28, 37, 0.74);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  padding: 0.55rem 0.6rem;
  display: grid;
  gap: 0.25rem;
  transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
}

.family-list-item:hover {
  transform: translateY(-1px);
  border-color: rgba(151, 221, 198, 0.45);
}

.family-list-item-active {
  background: linear-gradient(120deg, rgba(77, 232, 186, 0.22), rgba(82, 198, 239, 0.18));
  border-color: rgba(153, 229, 201, 0.6);
}

.family-item-name {
  font-size: 0.88rem;
  font-weight: 600;
}

.family-item-meta {
  font-size: 0.76rem;
  color: var(--muted);
}

.category-block {
  border: 1px solid rgba(152, 216, 197, 0.26);
  border-radius: 14px;
  padding: 0.75rem;
  background: rgba(6, 21, 29, 0.58);
}

.category-block h3 {
  font-size: 0.95rem;
}

.category-block p {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.2rem;
  margin-bottom: 0.5rem;
}

.family-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.family-chip {
  font-size: 0.78rem;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  background: rgba(77, 232, 186, 0.12);
  border: 1px solid rgba(108, 204, 177, 0.33);
}

.family-chip-btn {
  cursor: pointer;
  color: var(--text);
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.family-chip-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(141, 224, 195, 0.48);
}

.family-chip-active {
  background: linear-gradient(120deg, rgba(77, 232, 186, 0.32), rgba(82, 198, 239, 0.3));
  border-color: rgba(158, 229, 203, 0.8);
}

.behavior-list {
  display: grid;
  gap: 0.5rem;
  max-height: 32vh;
  overflow: auto;
  padding-right: 0.2rem;
}

.behavior-list-modal {
  max-height: 56vh;
}

.hash-list-modal {
  max-height: 24vh;
}

.behavior-item {
  border: 1px solid rgba(128, 195, 173, 0.26);
  border-radius: 10px;
  padding: 0.55rem;
  background: rgba(5, 20, 27, 0.74);
  display: grid;
  gap: 0.35rem;
}

.behavior-item-head {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.behavior-summary {
  font-size: 0.87rem;
  color: #d6e8e2;
}

.behavior-attr {
  font-size: 0.78rem;
  color: #afccc4;
  margin: 0;
}

.behavior-details {
  margin: 0;
  font-size: 0.79rem;
  line-height: 1.4;
  color: #bfd9d1;
}

.hash-value {
  font-family: "IBM Plex Mono", monospace;
  overflow-wrap: anywhere;
}

.family-modal {
  width: min(980px, 92vw);
  max-height: 88vh;
  padding: 0;
  border: 1px solid rgba(147, 214, 191, 0.3);
  border-radius: 18px;
  background: rgba(8, 27, 35, 0.92);
  color: var(--text);
  box-shadow: var(--shadow);
}

.family-modal::backdrop {
  background: rgba(4, 11, 16, 0.7);
  backdrop-filter: blur(3px);
}

.family-modal-shell {
  display: grid;
  gap: 0.8rem;
  padding: 1rem;
}

.family-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.family-modal-head h2 {
  font-size: 1.1rem;
}

.family-modal-body {
  display: grid;
  gap: 0.7rem;
}

.family-modal-content {
  display: grid;
  gap: 0.6rem;
}

.family-modal-name {
  font-size: 1.35rem;
}

.family-modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.hash-link-btn {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(121, 192, 170, 0.32);
  border-radius: 10px;
  background: rgba(7, 25, 33, 0.7);
  color: #d8ece6;
  padding: 0.5rem 0.55rem;
  cursor: pointer;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.77rem;
  overflow-wrap: anywhere;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.hash-link-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(158, 226, 202, 0.6);
}

.hash-link-btn.hash-link-active {
  border-color: rgba(77, 232, 186, 0.8);
  box-shadow: 0 0 0 2px rgba(77, 232, 186, 0.18);
}

.hash-table-wrap {
  max-height: 32vh;
  overflow: auto;
  border: 1px solid rgba(126, 196, 175, 0.26);
  border-radius: 10px;
  background: rgba(6, 21, 29, 0.78);
}

.hash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.hash-table th,
.hash-table td {
  border-bottom: 1px solid rgba(123, 193, 172, 0.2);
  padding: 0.45rem 0.5rem;
  text-align: left;
  vertical-align: top;
}

.hash-table th {
  position: sticky;
  top: 0;
  background: rgba(8, 28, 37, 0.95);
  z-index: 1;
  font-size: 0.75rem;
  color: #b8d7cf;
}

.hash-table tbody tr:hover {
  background: rgba(86, 153, 130, 0.08);
}

.hash-cell-btn {
  max-width: 520px;
}

.hash-note-cell {
  max-width: 300px;
  overflow-wrap: anywhere;
}

.gti-widget-panel {
  border: 1px solid rgba(140, 208, 187, 0.28);
  border-radius: 12px;
  padding: 0.7rem;
  background: rgba(6, 22, 30, 0.7);
  display: grid;
  gap: 0.55rem;
}

.gti-widget-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.gti-widget-frame {
  width: 100%;
  min-height: 340px;
  border: 1px solid rgba(129, 193, 173, 0.34);
  border-radius: 10px;
  background: rgba(4, 15, 21, 0.86);
}

.gti-overlay {
  width: min(1200px, 96vw);
  max-height: 92vh;
  border: 1px solid rgba(145, 215, 191, 0.34);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(9, 29, 38, 0.98), rgba(7, 22, 30, 0.97));
  color: var(--text);
  box-shadow: var(--shadow);
  padding: 0;
}

.gti-overlay::backdrop {
  background: rgba(5, 14, 20, 0.74);
  backdrop-filter: blur(3px);
}

.gti-overlay-shell {
  width: 100%;
  max-height: 92vh;
  overflow: auto;
  padding: 0.9rem;
  display: grid;
  gap: 0.7rem;
}

.gti-overlay-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.gti-overlay-head h2 {
  font-size: 1rem;
}

.gti-overlay-body {
  display: grid;
  gap: 0.6rem;
}

.gti-overlay .gti-widget-frame {
  min-height: 74vh;
}

.profile-dialog {
  width: min(640px, 92vw);
  padding: 0;
  border: 1px solid rgba(149, 215, 193, 0.32);
  border-radius: 18px;
  background: rgba(8, 26, 35, 0.95);
  color: var(--text);
  box-shadow: var(--shadow);
}

.profile-dialog::backdrop {
  background: rgba(4, 11, 16, 0.7);
  backdrop-filter: blur(3px);
}

.profile-dialog-shell {
  display: grid;
  gap: 0.8rem;
  padding: 1rem;
}

.profile-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.profile-dialog-head h2 {
  font-size: 1.1rem;
}

.profile-toggle-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.9rem;
}

.profile-toggle-row input[type="checkbox"] {
  width: auto;
}

.search-form {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.5rem;
}

.search-results {
  display: grid;
  gap: 0.7rem;
}

.result-card {
  border: 1px solid rgba(167, 217, 201, 0.28);
  border-radius: 14px;
  padding: 0.75rem;
  background: rgba(8, 25, 33, 0.66);
  display: grid;
  gap: 0.45rem;
}

.result-card .btn {
  justify-self: start;
}

.search-match-group {
  display: grid;
  gap: 0.4rem;
}

.inline-actions {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.pending-submissions {
  display: grid;
  gap: 0.6rem;
}

.submission-context {
  display: grid;
  gap: 0.65rem;
  max-height: 72vh;
  overflow: auto;
  padding-right: 0.2rem;
}

.submission-card {
  border: 1px solid rgba(149, 213, 192, 0.26);
  border-radius: 12px;
  padding: 0.7rem;
  background: rgba(7, 25, 33, 0.68);
  display: grid;
  gap: 0.45rem;
}

.submission-title {
  font-size: 0.9rem;
}

.submission-meta {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.submission-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.submission-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.submission-payload {
  font-size: 0.8rem;
  font-family: "IBM Plex Mono", monospace;
  color: #bdd6cf;
  background: rgba(4, 17, 23, 0.82);
  border: 1px solid rgba(128, 191, 171, 0.24);
  border-radius: 10px;
  padding: 0.45rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.mono-chip {
  border-radius: 999px;
  padding: 0.2rem 0.5rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  background: rgba(12, 43, 57, 0.9);
  border: 1px solid rgba(132, 203, 179, 0.33);
}

.behavior-snippet {
  font-size: 0.83rem;
  color: #bdd6cf;
  border-left: 2px solid rgba(97, 190, 163, 0.52);
  padding-left: 0.5rem;
}

.behavior-snippet-meta {
  display: grid;
  gap: 0.15rem;
  margin-top: 0.2rem;
}

.behavior-snippet-line {
  display: block;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.74rem;
}

.hash-snippet {
  border: 1px solid rgba(121, 192, 170, 0.24);
  border-radius: 10px;
  padding: 0.5rem;
  background: rgba(5, 20, 27, 0.68);
  display: grid;
  gap: 0.32rem;
}

.hash-snippet-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.hash-snippet-btn {
  font-size: 0.75rem;
  padding: 0.38rem 0.45rem;
}

.hash-snippet-meta {
  font-size: 0.74rem;
  color: #b7d1ca;
  font-family: "IBM Plex Mono", monospace;
  overflow-wrap: anywhere;
}

.global-message {
  position: fixed;
  right: 1.2rem;
  bottom: 1.2rem;
  border-radius: 12px;
  padding: 0.65rem 0.8rem;
  background: rgba(9, 27, 36, 0.92);
  border: 1px solid rgba(116, 189, 165, 0.38);
  font-size: 0.84rem;
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.global-message.visible {
  opacity: 1;
  transform: translateY(0);
}

.global-message.error {
  border-color: rgba(242, 127, 106, 0.55);
  color: #ffd5cc;
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .admin-workspace {
    grid-template-columns: 1fr;
  }

  .submit-workspace {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .search-form {
    grid-template-columns: 1fr;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes drift {
  from {
    transform: translateY(-8px);
  }
  to {
    transform: translateY(10px);
  }
}
