:root {
  --ink: #101613;
  --ink-soft: #26322d;
  --muted: #66736d;
  --muted-2: #8a9690;
  --line: #dde3df;
  --line-strong: #c8d0cb;
  --canvas: #f5f7f6;
  --panel: #ffffff;
  --panel-alt: #f9faf9;
  --graphite: #13221c;
  --graphite-2: #1f352b;
  --signal: #28724a;
  --signal-soft: #e4f4eb;
  --amber: #9d6a17;
  --amber-soft: #fff3d6;
  --focus: #2f6f50;
  --state-soft: #e8f3ed;
  --danger: #b0443c;
  --shadow-sm: 0 1px 2px rgba(16, 22, 19, 0.06);
  --shadow-md: 0 18px 50px rgba(16, 22, 19, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-size: 15px;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(47, 111, 80, 0.22);
  outline-offset: 2px;
}

a {
  color: inherit;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 14px;
  color: var(--ink);
  font-size: 46px;
  line-height: 1.02;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: 0;
}

p {
  color: var(--muted);
  line-height: 1.55;
}

.product-shell {
  min-height: 100vh;
}

.top-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(245, 247, 246, 0.92);
  padding: 14px 24px;
  backdrop-filter: blur(18px);
}

.brand-lockup,
.powered-by,
.nav-links {
  display: inline-flex;
  align-items: center;
}

.brand-lockup {
  gap: 10px;
  color: var(--ink);
  font-weight: 760;
  text-decoration: none;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.nav-links {
  justify-content: center;
  gap: 6px;
}

.nav-links a {
  border-radius: 8px;
  padding: 8px 11px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 680;
  text-decoration: none;
}

.nav-links a:hover {
  background: #ecf0ed;
  color: var(--ink);
}

.powered-by {
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.powered-by img {
  width: 96px;
  height: auto;
}

.app-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  min-height: calc(100vh - 59px);
}

.workspace {
  padding: 30px;
}

.console-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 22px;
}

.header-copy {
  max-width: 760px;
  margin-bottom: 0;
  font-size: 16px;
}

.header-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 10px;
}

.system-label {
  margin-bottom: 8px;
  color: var(--signal);
  font-size: 11px;
  font-weight: 820;
  letter-spacing: 0;
  text-transform: uppercase;
}

.ghost-button,
.primary-button,
.secondary-button,
.auth-form button,
.session-card button,
.watch-form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0 14px;
  cursor: pointer;
  font-weight: 760;
  text-decoration: none;
}

.ghost-button {
  background: var(--panel);
  color: var(--ink);
}

.ghost-button:hover {
  border-color: var(--ink-soft);
}

.primary-button {
  border-color: var(--graphite);
  background: var(--graphite);
  color: #ffffff;
}

.primary-button:hover {
  background: #0e1b16;
}

.secondary-button {
  background: #edf1ee;
  color: var(--muted);
  cursor: not-allowed;
}

.watch-form button {
  min-width: 132px;
  border-color: var(--graphite);
  background: var(--graphite);
  color: #ffffff;
}

.watch-form button:hover {
  background: #0e1b16;
}

button:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.status-strip article {
  min-height: 92px;
  border-right: 1px solid var(--line);
  padding: 18px;
}

.status-strip article:last-child {
  border-right: 0;
}

.status-strip span,
.metric-subtle {
  display: block;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.status-strip strong {
  color: var(--ink);
  font-size: 28px;
  line-height: 1;
}

.workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(260px, 0.8fr);
  gap: 16px;
  margin: 16px 0;
}

.create-watch-panel,
.coverage-panel,
.ledger-section,
.inspector-panel,
.powered-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.create-watch-panel,
.coverage-panel,
.ledger-section {
  box-shadow: var(--shadow-sm);
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  padding: 18px;
}

.panel-header h2,
.panel-header .system-label {
  margin-bottom: 0;
}

.state-pill,
#storage-status,
.event-type,
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.state-pill,
#storage-status {
  background: var(--state-soft);
  color: #1f5b3f;
}

.watch-form {
  display: grid;
  gap: 18px;
  padding: 18px;
}

.field-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.75fr);
  gap: 14px;
}

label,
fieldset {
  min-width: 0;
}

label span,
legend,
.cadence-control > span {
  display: block;
  margin-bottom: 8px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 820;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 0 13px;
}

input::placeholder {
  color: #9aa4a0;
}

input:focus,
select:focus {
  border-color: var(--focus);
}

.control-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 0.42fr);
  gap: 14px;
}

fieldset {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  border: 0;
  padding: 0;
}

fieldset legend {
  width: 100%;
}

.toggle-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-option span {
  min-height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  margin: 0;
  padding: 8px 12px;
  background: #ffffff;
  color: var(--ink-soft);
}

.toggle-option input:checked + span {
  border-color: var(--graphite);
  background: var(--graphite);
  color: #ffffff;
}

.form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.form-status {
  min-height: 21px;
  margin-bottom: 0;
  color: var(--signal);
  font-size: 13px;
  font-weight: 760;
}

.coverage-panel {
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(19, 34, 28, 0.03), rgba(19, 34, 28, 0)),
    var(--panel);
}

.coverage-panel p {
  margin-bottom: 18px;
}

.coverage-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.coverage-list li {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 740;
}

.coverage-list span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--signal);
}

.ledger-section {
  overflow: hidden;
}

.ledger-table {
  padding: 0 18px 18px;
}

.ledger-row,
.timeline li {
  display: grid;
  grid-template-columns: 92px minmax(140px, 1fr) 112px minmax(140px, 1fr) 132px;
  gap: 12px;
  align-items: center;
}

.ledger-head {
  border-bottom: 1px solid var(--line);
  padding: 13px 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 820;
  text-transform: uppercase;
}

.timeline {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline li {
  border-bottom: 1px solid var(--line);
  padding: 15px 0;
}

.timeline li:last-child {
  border-bottom: 0;
}

.timeline li:hover {
  background: var(--panel-alt);
}

.event-time,
.event-detail,
.event-observed,
.status-pill {
  font-size: 13px;
}

.event-time,
.event-detail {
  color: var(--muted);
}

.event-account,
.event-observed {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-weight: 760;
}

.event-type.followed {
  background: var(--signal-soft);
  color: #17613b;
}

.event-type.unfollowed {
  background: var(--amber-soft);
  color: var(--amber);
}

.status-pill {
  background: #edf1ee;
  color: var(--muted);
}

.inspector-panel {
  position: sticky;
  top: 59px;
  align-self: start;
  min-height: calc(100vh - 59px);
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  border-radius: 0;
  background: var(--graphite);
  color: #ffffff;
  padding: 24px;
}

.inspector-panel .system-label {
  color: #a8d7bd;
}

.inspector-panel h2 {
  color: #ffffff;
}

.inspector-panel p {
  color: rgba(255, 255, 255, 0.68);
}

.inspector-top {
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
  padding-bottom: 18px;
}

.inspector-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0;
}

.inspector-status span {
  min-height: 26px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 5px 10px;
  color: rgba(255, 255, 255, 0.74);
  font-size: 12px;
  font-weight: 760;
}

.auth-panel {
  scroll-margin-top: 92px;
  display: grid;
  gap: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  margin-bottom: 14px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.055);
}

.auth-panel.is-highlighted {
  animation: auth-panel-pulse 1.4s ease;
}

@keyframes auth-panel-pulse {
  0% {
    border-color: #f7f4ec;
    box-shadow: 0 0 0 0 rgba(247, 244, 236, 0.5);
  }

  45% {
    border-color: #f7f4ec;
    box-shadow: 0 0 0 6px rgba(247, 244, 236, 0.16);
  }

  100% {
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow: 0 0 0 0 rgba(247, 244, 236, 0);
  }
}

.panel-mini-header {
  display: grid;
  gap: 4px;
}

.panel-mini-header span,
.session-card span {
  color: #a8d7bd;
  font-size: 11px;
  font-weight: 820;
  text-transform: uppercase;
}

.panel-mini-header strong,
.session-card strong {
  color: #ffffff;
  font-size: 15px;
}

.auth-form {
  display: grid;
  gap: 10px;
}

.auth-form label span {
  color: rgba(255, 255, 255, 0.78);
}

.auth-form input {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.auth-form input::placeholder {
  color: rgba(255, 255, 255, 0.42);
}

.auth-form button,
.session-card button {
  width: 100%;
  border-color: #f7f4ec;
  background: #f7f4ec;
  color: var(--graphite);
}

.auth-message {
  min-height: 19px;
  margin-bottom: 0;
  font-size: 12px;
}

.auth-message[data-tone="success"] {
  color: #a8d7bd;
}

.auth-message[data-tone="warning"] {
  color: #e8bd68;
}

.auth-message[data-tone="error"] {
  color: #ffb2aa;
}

.session-card {
  display: grid;
  gap: 8px;
}

.watch-list {
  display: grid;
  gap: 10px;
  min-height: 132px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.watch-list li {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.055);
}

.watch-list strong {
  display: block;
  overflow-wrap: anywhere;
  color: #ffffff;
  font-size: 15px;
}

.watch-list span {
  display: block;
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 13px;
}

.powered-card {
  margin-top: 18px;
  padding: 16px;
  background: #f7f4ec;
}

.powered-card span {
  display: block;
  margin-bottom: 8px;
  color: #6f766f;
  font-size: 11px;
  font-weight: 820;
  text-transform: uppercase;
}

.powered-card img {
  width: 118px;
  height: auto;
}

.powered-card p {
  margin: 12px 0 0;
  color: #59615b;
  font-size: 13px;
}

.fine-print {
  margin: 18px 0 0;
  border-left: 3px solid #e8bd68;
  padding-left: 12px;
  font-size: 12px;
}

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

  .inspector-panel {
    position: static;
    min-height: auto;
    border-left: 0;
  }
}

@media (max-width: 860px) {
  .top-nav {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .nav-links {
    justify-content: flex-start;
    overflow-x: auto;
  }

  .powered-by {
    justify-content: flex-start;
  }

  .workspace {
    padding: 22px;
  }

  .console-header,
  .header-actions,
  .form-footer {
    display: grid;
  }

  .header-actions {
    width: 100%;
  }

  .ghost-button,
  .primary-button,
  .secondary-button,
  .watch-form button {
    width: 100%;
  }

  .status-strip,
  .workbench,
  .field-grid,
  .control-grid {
    grid-template-columns: 1fr;
  }

  .status-strip article {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .status-strip article:last-child {
    border-bottom: 0;
  }

  h1 {
    font-size: 40px;
  }

  .ledger-head {
    display: none;
  }

  .ledger-row,
  .timeline li {
    grid-template-columns: 1fr;
  }

  .timeline li {
    gap: 8px;
  }
}

@media (max-width: 520px) {
  .workspace,
  .inspector-panel {
    padding: 18px;
  }

  h1 {
    font-size: 34px;
  }
}
