﻿:root {
  color-scheme: light;
  --bg: #f5f6f8;
  --surface: rgba(255, 255, 255, .84);
  --solid: #ffffff;
  --ink: #111827;
  --muted: #667085;
  --line: #e3e7ee;
  --line-strong: #cfd6e2;
  --blue: #2563eb;
  --green: #12805c;
  --amber: #b7791f;
  --shadow: 0 16px 40px rgba(17, 24, 39, .08);
  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-family: var(--font);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #fff 0%, var(--bg) 52%, #eef2f7 100%);
  color: var(--ink);
}
button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.app-shell {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(24px) saturate(150%);
  padding: 24px 18px;
}
.brand img { display: block; height: 34px; width: auto; }
.side-nav { display: grid; gap: 5px; }
.side-nav a {
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  padding: 10px 12px;
  text-decoration: none;
}
.side-nav a.active,
.side-nav a:hover {
  background: #eef4ff;
  color: var(--blue);
}
.sidebar-note {
  margin-top: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 14px;
}
.sidebar-note span,
.section-label,
.eyebrow {
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.sidebar-note span { color: var(--muted); }
.sidebar-note strong { display: block; margin: 7px 0 5px; }
.sidebar-note p { margin: 0; }

.workspace {
  display: grid;
  gap: 16px;
  min-width: 0;
  padding: 28px;
}
.hero,
.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  backdrop-filter: blur(22px) saturate(150%);
  padding: 24px;
}
.hero > div { max-width: 900px; }
.eyebrow,
.section-label { display: block; margin: 0 0 7px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: 44px; line-height: 1; letter-spacing: 0; }
h2 { margin-bottom: 0; font-size: 24px; letter-spacing: 0; }
h3 { margin-bottom: 7px; font-size: 18px; }
p { color: var(--muted); line-height: 1.5; }
.hero p:last-child,
.sidebar-note p,
.rules p,
.selected-card p { font-size: 13px; }

button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
  padding: 0 14px;
}
button:hover { background: #0b1220; }
button:disabled {
  background: #a9b2c1;
  cursor: wait;
}
.secondary-button {
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
}
.secondary-button:hover {
  border-color: var(--blue);
  background: #eef4ff;
  color: var(--blue);
}
.status-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  padding: 0 10px;
  text-transform: uppercase;
}

.bridge-grid {
  display: grid;
  grid-template-columns: minmax(320px, .48fr) minmax(0, .52fr);
  gap: 16px;
  align-items: start;
}
.panel { padding: 18px; }
.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.packet-list {
  display: grid;
  gap: 9px;
}
.packet-row {
  width: 100%;
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 12px;
  text-align: left;
}
.packet-row:hover,
.packet-row.active {
  border-color: #9bbcff;
  background: #f7faff;
}
.packet-row strong { font-size: 15px; }
.packet-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.packet-row mark {
  justify-self: start;
  border-radius: 999px;
  background: #ecfdf3;
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
  padding: 5px 8px;
  text-transform: uppercase;
}
.packet-row.blocked mark {
  background: #fff8e6;
  color: var(--amber);
}
.selected-card,
.rules,
.portal-review-note {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 14px;
}
.field-preview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0 0;
}
.field-preview div {
  border-top: 1px solid var(--line);
  padding-top: 9px;
}
dt {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}
dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
}
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 12px;
}
.rules {
  margin-top: 12px;
}
.rules span {
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.rules p { margin: 6px 0 0; }

.portal-workspace-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background: rgba(3, 7, 18, .72);
  padding: 18px;
}
.portal-window {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1180px, 100%);
  height: min(760px, calc(100vh - 36px));
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 8px;
  background: #eef2f7;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .32);
}
.portal-window-bar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 10px 12px;
}
.window-dots {
  display: flex;
  gap: 6px;
}
.window-dots span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #cfd6e2;
}
.address-bar {
  min-height: 34px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 32px;
  padding: 0 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.window-close {
  min-height: 34px;
  background: #fff;
  border: 1px solid var(--line-strong);
  color: var(--ink);
}
.portal-workspace-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 16px;
  min-height: 0;
  padding: 16px;
}
.portal-page-surface,
.extension-popup {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}
.portal-page-surface {
  display: grid;
  min-height: 0;
  overflow: auto;
  padding: 22px;
}
.portal-login {
  align-self: center;
  width: min(460px, 100%);
  margin: 0 auto;
}
.portal-login input,
.portal-login button { margin-bottom: 12px; }
label {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 800;
}
input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 11px 12px;
}
input:focus {
  border-color: var(--blue);
  outline: 3px solid rgba(37, 99, 235, .16);
}
.portal-form {
  display: grid;
  gap: 16px;
}
.portal-form-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}
.portal-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.portal-form-grid label {
  display: grid;
  gap: 7px;
  margin: 0;
}
.portal-form-grid input.filled {
  border-color: rgba(18, 128, 92, .38);
  background: #ecfdf3;
}
.portal-review-note {
  display: grid;
  gap: 4px;
  color: var(--muted);
}
.portal-review-note strong { color: var(--ink); }
.extension-popup {
  align-self: start;
  display: grid;
  gap: 12px;
  padding: 14px;
}
.extension-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.extension-head span {
  display: block;
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.extension-head strong { display: block; margin-top: 4px; }
.extension-popup p { margin-bottom: 0; font-size: 13px; }
.extension-head mark {
  border-radius: 999px;
  background: #ecfdf3;
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
  padding: 5px 8px;
  text-transform: uppercase;
}
.safe-fill-steps {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 20px;
}
.safe-fill-steps li {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.safe-fill-steps li.done { color: var(--green); }
.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 230;
  max-width: min(420px, calc(100vw - 36px));
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow);
  font-size: 14px;
  font-weight: 800;
  padding: 12px 14px;
}

@media (max-width: 1050px) {
  .bridge-grid,
  .portal-workspace {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 860px) {
  body { overflow-x: hidden; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    gap: 12px;
    overflow: hidden;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 16px;
  }
  .brand img { height: 28px; }
  .side-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .side-nav a {
    font-size: 13px;
    padding: 8px 10px;
  }
  .sidebar-note { display: none; }
  .hero {
    display: grid;
  }
  .portal-window {
    height: calc(100vh - 24px);
  }
  .portal-window-bar {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .window-dots { display: none; }
}
@media (max-width: 680px) {
  .workspace { padding: 16px; }
  h1 { font-size: 34px; }
  h2 { font-size: 20px; }
  .field-preview,
  .portal-form-grid {
    grid-template-columns: 1fr;
  }
  .panel,
  .hero { padding: 15px; }
  .action-row,
  .action-row button {
    width: 100%;
  }
}
