:root{
  --bg:#07090d;
  --bg-2:#0c1017;
  --panel:#11161f;
  --panel-2:#151b25;
  --panel-3:#1b2230;
  --panel-soft:rgba(17,22,31,.82);
  --border:rgba(255,255,255,.08);
  --border-strong:rgba(214,179,118,.24);
  --gold:#d6b47a;
  --gold-strong:#ecc88d;
  --gold-soft:rgba(214,180,122,.10);
  --gold-glow:rgba(214,180,122,.18);
  --text:#f5f1ea;
  --text-2:#d7d0c6;
  --muted:#9c978e;
  --dim:#77736b;
  --success:#8bb79f;
  --danger:#dc8d8d;
  --warning:#d5ac68;
  --radius-xl:34px;
  --radius-lg:28px;
  --radius-md:22px;
  --radius-sm:16px;
  --sidebar:296px;
  --shadow:0 30px 80px rgba(0,0,0,.34);
  --shadow-soft:0 18px 44px rgba(0,0,0,.22);
}

*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%}
body{
  position:relative;
  overflow-x:hidden;
  background:
    radial-gradient(circle at top left, rgba(214,180,122,.16), transparent 26%),
    radial-gradient(circle at 88% 0%, rgba(214,180,122,.08), transparent 18%),
    radial-gradient(circle at 18% 100%, rgba(118,135,173,.09), transparent 24%),
    linear-gradient(180deg, #07090d 0%, #090c11 42%, #0a0e15 100%);
  color:var(--text);
  font-family:'Manrope',system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
  font-size:14px;
  line-height:1.7;
}
body::before{
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
  background:
    linear-gradient(90deg, transparent 0, transparent calc(50% - 1px), rgba(255,255,255,.02) calc(50% - 1px), rgba(255,255,255,.02) calc(50% + 1px), transparent calc(50% + 1px)),
    linear-gradient(rgba(255,255,255,.015), rgba(255,255,255,0));
  opacity:.5;
}
button,input,textarea,select{font:inherit}
a{text-decoration:none;color:inherit}
.hidden{display:none !important}

.auth-shell{
  min-height:100vh;
  padding:32px 18px;
  display:grid;
  place-items:center;
}

.auth-panel{
  width:min(980px,100%);
  display:grid;
  grid-template-columns:minmax(280px,.92fr) minmax(0,1.08fr);
  border:1px solid rgba(255,255,255,.08);
  border-radius:38px;
  overflow:hidden;
  background:
    linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02)),
    rgba(13,17,24,.82);
  box-shadow:0 38px 110px rgba(0,0,0,.42);
  backdrop-filter:blur(18px);
}

.auth-side{
  padding:42px 38px;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  gap:28px;
  border-right:1px solid rgba(255,255,255,.06);
  background:
    radial-gradient(circle at 18% 16%, rgba(214,180,122,.28), transparent 28%),
    radial-gradient(circle at 85% 76%, rgba(255,255,255,.06), transparent 18%),
    linear-gradient(180deg, rgba(255,255,255,.03), transparent 60%),
    linear-gradient(180deg, #121720 0%, #0f131b 100%);
}

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

.auth-mark{
  font-family:'Cormorant Garamond',serif;
  font-size:54px;
  line-height:.92;
  letter-spacing:.05em;
  color:var(--gold-strong);
}

.auth-sub{
  max-width:28ch;
  color:var(--text-2);
  font-size:15px;
}

.auth-chips{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}

.auth-chip{
  display:inline-flex;
  align-items:center;
  padding:10px 13px;
  border:1px solid rgba(255,255,255,.08);
  border-radius:999px;
  background:rgba(255,255,255,.03);
  color:var(--text-2);
  font-size:12px;
  letter-spacing:.04em;
}

.auth-form{
  display:flex;
  flex-direction:column;
  justify-content:center;
  padding:42px 42px 38px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.035), transparent 48%),
    rgba(16,20,29,.78);
}

.auth-eyebrow{
  margin-bottom:14px;
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.24em;
  color:var(--dim);
}

.auth-tabs{
  display:flex;
  gap:8px;
  margin-bottom:22px;
}

.auth-tab{
  border:1px solid var(--border);
  background:rgba(255,255,255,.02);
  color:var(--muted);
  border-radius:999px;
  padding:11px 16px;
  cursor:pointer;
  transition:background .18s ease,color .18s ease,border-color .18s ease,transform .18s ease;
}

.auth-tab.active,
.auth-tab:hover{
  color:var(--gold-strong);
  border-color:var(--border-strong);
  background:var(--gold-soft);
}

.auth-form-title{
  font-family:'Cormorant Garamond',serif;
  font-size:34px;
  line-height:1;
  margin-bottom:8px;
}

.auth-form-sub{
  color:var(--muted);
  margin-bottom:22px;
}

.form-grid{display:grid;gap:16px}
.form-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}

label{
  display:block;
  margin-bottom:8px;
  color:var(--muted);
  font-size:10px;
  text-transform:uppercase;
  letter-spacing:.18em;
}

input,textarea,select{
  width:100%;
  border:none;
  outline:none;
  color:var(--text);
  border-radius:18px;
  padding:14px 15px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.01)),
    var(--panel-2);
  border:1px solid rgba(255,255,255,.07);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.02);
  transition:border-color .18s ease,box-shadow .18s ease,background .18s ease,transform .18s ease;
}

input::placeholder,
textarea::placeholder{color:#807a71}

input:focus,textarea:focus,select:focus{
  border-color:rgba(214,180,122,.46);
  box-shadow:0 0 0 4px rgba(214,180,122,.08);
  background:
    linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.015)),
    #1a212c;
}

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

.hint{
  min-height:18px;
  color:var(--muted);
  font-size:12px;
}

.tiny{font-size:12px;color:var(--dim)}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  border-radius:16px;
  border:1px solid transparent;
  padding:12px 16px;
  min-height:46px;
  cursor:pointer;
  transition:transform .18s ease,background .18s ease,border-color .18s ease,color .18s ease,opacity .18s ease,box-shadow .18s ease;
}

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

.btn-primary{
  background:linear-gradient(180deg, var(--gold-strong), var(--gold));
  color:#19150e;
  font-weight:700;
  box-shadow:0 14px 30px rgba(214,180,122,.18);
}

.btn-primary:hover{opacity:.96}

.btn-secondary{
  background:rgba(255,255,255,.025);
  color:var(--text-2);
  border-color:rgba(255,255,255,.08);
}

.btn-secondary:hover{
  color:var(--gold-strong);
  border-color:var(--border-strong);
  background:rgba(214,180,122,.08);
}

.btn-danger{
  background:rgba(220,141,141,.06);
  color:var(--danger);
  border-color:rgba(220,141,141,.26);
}

.btn-small{
  min-height:auto;
  padding:9px 13px;
  border-radius:14px;
  font-size:12px;
}

.btn-row{display:flex;gap:10px;flex-wrap:wrap}
.top-gap{margin-top:16px}

.badge{
  display:inline-flex;
  align-items:center;
  gap:7px;
  padding:7px 11px;
  border-radius:999px;
  border:1px solid rgba(214,180,122,.18);
  background:rgba(214,180,122,.10);
  color:var(--gold-strong);
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.1em;
}

.badge.success{
  color:var(--success);
  background:rgba(139,183,159,.10);
  border-color:rgba(139,183,159,.22);
}

.badge.danger{
  color:var(--danger);
  background:rgba(220,141,141,.08);
  border-color:rgba(220,141,141,.22);
}

.badge.muted{
  background:rgba(255,255,255,.02);
  color:var(--muted);
  border-color:rgba(255,255,255,.08);
}

.status-chip{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:9px 12px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.08);
  background:rgba(255,255,255,.03);
  color:var(--text-2);
  font-size:12px;
  white-space:nowrap;
}

.status-chip.ready{
  color:var(--success);
  border-color:rgba(139,183,159,.24);
  background:rgba(139,183,159,.10);
}

.status-chip.warn{
  color:var(--warning);
  border-color:rgba(213,172,104,.24);
  background:rgba(213,172,104,.10);
}

.shell{
  display:grid;
  grid-template-columns:var(--sidebar) minmax(0,1fr);
  min-height:100vh;
}

.sidebar{
  position:sticky;
  top:0;
  height:100vh;
  height:100dvh;
  overflow-y:auto;
  padding:20px 18px 24px;
  display:flex;
  flex-direction:column;
  gap:18px;
  background:rgba(9,12,18,.82);
  backdrop-filter:blur(24px);
  border-right:1px solid rgba(255,255,255,.06);
}

.brand{
  padding:18px 16px 22px;
  border-bottom:1px solid rgba(255,255,255,.06);
}

.brand .mark{
  font-family:'Cormorant Garamond',serif;
  font-size:34px;
  letter-spacing:.05em;
  color:var(--gold-strong);
}

.brand .sub{
  margin-top:5px;
  color:var(--dim);
  font-size:10px;
  letter-spacing:.26em;
  text-transform:uppercase;
}

.workspace-box,
.user-box{
  position:relative;
  overflow:hidden;
  border-radius:24px;
  border:1px solid rgba(255,255,255,.07);
  background:
    linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.015)),
    rgba(18,23,32,.84);
  box-shadow:var(--shadow-soft);
  padding:18px;
}

.workspace-box::before,
.user-box::before,
.panel::before,
.hero::before{
  content:"";
  position:absolute;
  left:0;
  top:0;
  right:0;
  height:1px;
  background:linear-gradient(90deg, transparent, rgba(255,255,255,.16), transparent);
  opacity:.5;
}

.workspace-meta,
.user-meta{color:var(--muted);font-size:12px}

.workspace-box .user-name{
  font-size:23px;
  line-height:1.05;
  overflow-wrap:anywhere;
}

.workspace-pills{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.workspace-pill{
  display:inline-flex;
  align-items:center;
  padding:8px 10px;
  border-radius:999px;
  background:rgba(255,255,255,.03);
  border:1px solid rgba(255,255,255,.06);
  color:var(--text-2);
  font-size:11px;
}

.user-head{
  display:flex;
  align-items:center;
  gap:14px;
  min-width:0;
}

.user-head > div:last-child{
  min-width:0;
  flex:1;
}

.user-avatar{
  width:50px;
  height:50px;
  border-radius:18px;
  display:grid;
  place-items:center;
  background:linear-gradient(180deg, rgba(214,180,122,.22), rgba(214,180,122,.08));
  border:1px solid rgba(214,180,122,.20);
  color:var(--gold-strong);
  font-weight:700;
  letter-spacing:.06em;
}

.user-name{
  font-family:'Cormorant Garamond',serif;
  font-size:25px;
  line-height:1.05;
  margin-bottom:4px;
  overflow-wrap:anywhere;
}

.user-box .user-name{
  font-size:22px;
}

.user-box .user-meta,
#userEmailLabel{
  overflow-wrap:anywhere;
  word-break:break-word;
}

.nav{display:grid;gap:8px}

.nav button{
  width:100%;
  border:none;
  background:rgba(255,255,255,.01);
  color:var(--muted);
  text-align:left;
  padding:14px 15px;
  border-radius:18px;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  transition:background .18s ease,color .18s ease,border-color .18s ease,transform .18s ease;
  border:1px solid transparent;
}

.nav button:hover,
.nav button.active{
  background:rgba(214,180,122,.10);
  color:var(--gold-strong);
  border-color:rgba(214,180,122,.14);
}

.nav-left{display:flex;align-items:center;gap:11px}
.side-actions{margin-top:auto;display:grid;gap:10px}

.sidebar::-webkit-scrollbar{width:4px}
.sidebar::-webkit-scrollbar-thumb{
  background:rgba(214,180,122,.24);
  border-radius:999px;
}
.sidebar::-webkit-scrollbar-track{background:transparent}

.main{
  min-width:0;
  display:flex;
  flex-direction:column;
}

.topbar{
  position:sticky;
  top:0;
  z-index:20;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:18px 28px;
  backdrop-filter:blur(22px);
  background:rgba(8,11,16,.72);
  border-bottom:1px solid rgba(255,255,255,.06);
}

.topbar-left{
  display:flex;
  align-items:center;
  gap:14px;
  min-width:0;
}

.topbar-title{
  font-family:'Cormorant Garamond',serif;
  font-size:38px;
  line-height:1;
}

.topbar-sub{
  margin-top:4px;
  font-size:12px;
  color:var(--muted);
}

.topbar-actions{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.status-row{
  display:flex;
  align-items:center;
  gap:10px;
}

.sync-dot{
  width:10px;
  height:10px;
  border-radius:50%;
  background:var(--success);
  box-shadow:0 0 0 7px rgba(139,183,159,.10);
}

.sync-dot.local{
  background:var(--warning);
  box-shadow:0 0 0 7px rgba(213,172,104,.10);
}

.right-muted{color:var(--muted);font-size:12px}

.icon-btn{
  width:46px;
  height:46px;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.08);
  background:rgba(255,255,255,.03);
  color:var(--text);
  display:none;
  place-items:center;
  cursor:pointer;
}

.content{padding:28px 28px 36px}
.view{display:none}
.view.active{display:block}

.panel{
  position:relative;
  overflow:hidden;
  border-radius:30px;
  padding:22px;
  border:1px solid rgba(255,255,255,.07);
  background:
    linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.01)),
    rgba(17,22,31,.86);
  box-shadow:var(--shadow-soft);
}

.panel + .panel{margin-top:18px}

.section-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  margin-bottom:18px;
}

.section-title{
  font-family:'Cormorant Garamond',serif;
  font-size:31px;
  line-height:1;
}

.section-copy{
  margin-top:6px;
  max-width:62ch;
  color:var(--muted);
  font-size:13px;
}

.hero{
  position:relative;
  overflow:hidden;
  border-radius:34px;
  padding:28px;
  border:1px solid rgba(214,180,122,.16);
  background:
    radial-gradient(circle at 86% 12%, rgba(214,180,122,.18), transparent 22%),
    radial-gradient(circle at 16% 100%, rgba(101,124,157,.12), transparent 26%),
    linear-gradient(180deg, rgba(255,255,255,.045), transparent 56%),
    rgba(17,22,31,.88);
  box-shadow:var(--shadow);
}

.hero-grid{
  display:grid;
  grid-template-columns:minmax(0,1.08fr) 320px;
  gap:18px;
  align-items:stretch;
}

.hero-main{
  display:grid;
  gap:18px;
}

.hero-kickers{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}

.hero h2{
  font-family:'Cormorant Garamond',serif;
  font-size:60px;
  line-height:.92;
  max-width:11ch;
  letter-spacing:-.02em;
}

.hero p{
  max-width:62ch;
  color:var(--text-2);
  font-size:15px;
}

.hero-actions{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
}

.hero-foot{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;
}

.hero-foot-card{
  padding:16px 18px;
  border-radius:22px;
  border:1px solid rgba(255,255,255,.07);
  background:rgba(255,255,255,.03);
}

.hero-foot-card span{
  display:block;
  margin-bottom:6px;
  color:var(--muted);
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.16em;
}

.hero-foot-card strong{
  font-family:'Cormorant Garamond',serif;
  font-size:29px;
  color:var(--gold-strong);
  line-height:1;
}

.hero-side{display:grid}

.priority-card{
  display:grid;
  gap:14px;
  padding:20px;
  border-radius:28px;
  border:1px solid rgba(255,255,255,.08);
  background:rgba(8,11,17,.42);
  backdrop-filter:blur(12px);
}

.priority-list{display:grid;gap:10px}

.priority-item{
  padding:14px 15px;
  border-radius:18px;
  border:1px solid rgba(255,255,255,.06);
  background:rgba(255,255,255,.03);
}

.priority-item strong{
  display:block;
  font-size:14px;
  margin-bottom:4px;
}

.priority-item span{
  color:var(--muted);
  font-size:12px;
}

.priority-item em{
  display:inline-block;
  margin-top:8px;
  color:var(--gold-strong);
  font-style:normal;
  font-size:11px;
  letter-spacing:.08em;
  text-transform:uppercase;
}

.grid-4{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}
.grid-3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
.grid-2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}

.stat{
  padding:20px;
  border-radius:24px;
  border:1px solid rgba(255,255,255,.08);
  background:
    linear-gradient(180deg, rgba(214,180,122,.07), transparent 74%),
    rgba(19,24,33,.92);
  box-shadow:var(--shadow-soft);
  transition:transform .18s ease,border-color .18s ease;
}

.stat:hover{
  transform:translateY(-2px);
  border-color:rgba(214,180,122,.18);
}

.stat-number{
  font-family:'Cormorant Garamond',serif;
  font-size:46px;
  line-height:.9;
  color:var(--gold-strong);
  margin-bottom:10px;
}

.stat-label{
  color:var(--muted);
  font-size:10px;
  text-transform:uppercase;
  letter-spacing:.22em;
}

.card-list{display:grid;gap:14px}

.item-card,
.archive-item{
  border-radius:24px;
  border:1px solid rgba(255,255,255,.07);
  background:
    linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.01)),
    rgba(20,26,37,.88);
  padding:18px;
  box-shadow:var(--shadow-soft);
  transition:transform .18s ease,border-color .18s ease;
}

.item-card:hover,
.archive-item:hover{
  transform:translateY(-2px);
  border-color:rgba(214,180,122,.16);
}

.item-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}

.item-title{
  font-size:17px;
  font-weight:700;
  margin-bottom:6px;
}

.item-meta{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  color:var(--muted);
  font-size:13px;
}

.item-actions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:14px;
}

.kv{display:grid;gap:10px}

.kv-row{
  display:grid;
  grid-template-columns:130px 1fr;
  gap:12px;
  padding:10px 0;
  border-bottom:1px dashed rgba(255,255,255,.07);
}

.kv-row:last-child{border-bottom:none}

.kv-key{
  color:var(--dim);
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.16em;
}

.kv-val{color:var(--text-2)}

.inline-filters{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.chip{
  border:1px solid rgba(255,255,255,.08);
  background:rgba(255,255,255,.02);
  color:var(--muted);
  border-radius:999px;
  padding:10px 15px;
  cursor:pointer;
  transition:background .18s ease,color .18s ease,border-color .18s ease,transform .18s ease;
}

.chip.active,
.chip:hover{
  color:var(--gold-strong);
  border-color:rgba(214,180,122,.22);
  background:rgba(214,180,122,.10);
}

.search-row{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  align-items:center;
}

.grow{flex:1 1 220px}

.empty{
  padding:34px 20px;
  border-radius:22px;
  border:1px dashed rgba(214,180,122,.18);
  text-align:center;
  color:var(--muted);
  background:rgba(255,255,255,.015);
}

.empty strong{
  display:block;
  margin-bottom:6px;
  color:var(--text);
}

.note{
  padding:16px 18px;
  border-radius:22px;
  border:1px solid rgba(214,180,122,.16);
  background:
    linear-gradient(180deg, rgba(214,180,122,.09), rgba(214,180,122,.04)),
    rgba(20,25,35,.85);
  color:var(--text-2);
}

.ai-console{display:grid;gap:16px}

.ai-console-actions{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}

.ai-inline-note{
  min-height:100%;
  display:flex;
  align-items:center;
  padding:14px 16px;
  border-radius:18px;
  border:1px solid rgba(255,255,255,.08);
  background:rgba(255,255,255,.025);
  color:var(--muted);
}

.ai-output{
  min-height:220px;
  white-space:pre-wrap;
  line-height:1.85;
}

.split{
  display:grid;
  grid-template-columns:minmax(0,1.08fr) minmax(360px,.92fr);
  gap:18px;
}

.doc-intro{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  margin-bottom:18px;
  padding:18px;
  border-radius:24px;
  border:1px solid rgba(255,255,255,.07);
  background:
    radial-gradient(circle at top right, rgba(214,180,122,.14), transparent 28%),
    rgba(255,255,255,.02);
}

.doc-metrics{
  display:grid;
  gap:10px;
  min-width:140px;
}

.mini-stat{
  padding:12px 14px;
  border-radius:18px;
  border:1px solid rgba(255,255,255,.07);
  background:rgba(255,255,255,.03);
}

.mini-stat span{
  display:block;
  margin-bottom:4px;
  color:var(--muted);
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.18em;
}

.mini-stat strong{
  font-size:18px;
  color:var(--text);
}

.output-meta{
  display:grid;
  gap:6px;
  padding:16px 18px;
  border-radius:22px;
  border:1px solid rgba(255,255,255,.07);
  background:rgba(255,255,255,.02);
  margin-bottom:14px;
}

.output-meta-label{
  color:var(--dim);
  font-size:10px;
  text-transform:uppercase;
  letter-spacing:.2em;
}

.output-meta-title{
  font-family:'Cormorant Garamond',serif;
  font-size:32px;
  line-height:1;
}

.output-meta-sub{
  color:var(--muted);
  font-size:13px;
}

.doc-output{
  min-height:420px;
  max-height:720px;
  overflow:auto;
  padding:22px;
  border-radius:24px;
  border:1px solid rgba(255,255,255,.07);
  background:
    linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.008)),
    #0d1219;
  color:#f0ede6;
  white-space:pre-wrap;
  line-height:1.95;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.03);
}

.archive-item + .archive-item{margin-top:12px}

.code-box{
  width:100%;
  min-height:240px;
  font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;
  font-size:12px;
  line-height:1.6;
  background:#0c1018;
}

.mobile-nav{display:none}
.backdrop{display:none}

.overdue{color:var(--danger)}
.due-soon{color:var(--warning)}
.completed{color:var(--success)}

hr.sep{
  border:none;
  border-top:1px solid rgba(255,255,255,.08);
  margin:18px 0;
}

.toast{
  position:fixed;
  right:18px;
  bottom:18px;
  z-index:200;
  max-width:min(420px,calc(100vw - 26px));
  padding:15px 17px;
  border-radius:18px;
  border:1px solid rgba(255,255,255,.08);
  background:rgba(12,16,23,.92);
  box-shadow:var(--shadow);
  backdrop-filter:blur(16px);
  transform:translateY(20px);
  opacity:0;
  pointer-events:none;
  transition:.22s ease;
}

.toast.show{
  opacity:1;
  transform:translateY(0);
}

.loader{
  width:18px;
  height:18px;
  border-radius:50%;
  border:2px solid rgba(214,180,122,.16);
  border-top-color:var(--gold);
  animation:spin .8s linear infinite;
}

.loading-inline{
  display:inline-flex;
  align-items:center;
  gap:8px;
  color:var(--muted);
}

@keyframes spin{to{transform:rotate(360deg)}}

.mediation-workbench{display:grid;gap:18px}

.mediation-intro{
  padding:24px 24px 22px;
  border-radius:28px;
  border:1px solid rgba(214,180,122,.16);
  background:
    radial-gradient(circle at top right, rgba(214,180,122,.16), transparent 24%),
    linear-gradient(180deg, rgba(255,255,255,.04), transparent 64%),
    rgba(20,26,36,.92);
}

.mediation-intro h3{
  font-family:'Cormorant Garamond',serif;
  font-size:34px;
  line-height:.96;
  margin:14px 0 10px;
}

.mediation-intro p{
  max-width:68ch;
  color:var(--text-2);
}

.mediation-attorney-line{
  margin-top:14px;
  color:var(--muted);
  font-size:13px;
}

.med-link-row{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:14px;
}

.med-type-caption{
  margin-bottom:-6px;
  color:var(--muted);
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.16em;
}

.med-type-selector{
  display:flex;
  gap:1px;
  padding:1px;
  border-radius:18px;
  background:rgba(255,255,255,.08);
}

.med-type-btn{
  flex:1;
  border:none;
  border-radius:17px;
  background:transparent;
  color:var(--muted);
  padding:13px 14px;
  cursor:pointer;
  transition:.18s ease;
}

.med-type-btn.active,
.med-type-btn:hover{
  background:rgba(255,255,255,.04);
  color:var(--gold-strong);
}

.med-form-section{
  overflow:hidden;
  border-radius:28px;
  border:1px solid rgba(214,180,122,.14);
  background:
    linear-gradient(180deg, rgba(255,255,255,.025), transparent 70%),
    rgba(20,26,36,.92);
}

.med-form-section-header{
  display:flex;
  align-items:flex-start;
  gap:12px;
  padding:20px;
  border-bottom:1px solid rgba(214,180,122,.10);
  background:rgba(214,180,122,.05);
}

.med-form-index{
  width:36px;
  height:36px;
  border-radius:50%;
  display:grid;
  place-items:center;
  flex-shrink:0;
  background:rgba(214,180,122,.12);
  color:var(--gold-strong);
  font-size:12px;
  letter-spacing:.12em;
}

.med-form-title{
  font-family:'Cormorant Garamond',serif;
  font-size:25px;
  line-height:1;
}

.med-form-section-body{
  display:grid;
  gap:14px;
  padding:20px;
}

.med-form-stack{display:grid;gap:14px}

.med-form-row{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
}

.med-form-field{
  display:grid;
  gap:6px;
}

.med-form-field label{
  margin-bottom:0;
  color:var(--muted);
  font-size:11px;
  letter-spacing:.16em;
}

.med-form-field label .req{
  color:var(--gold-strong);
  margin-left:2px;
}

.med-form-field label .fixed-tag{
  margin-left:6px;
  padding:2px 7px;
  border-radius:999px;
  background:rgba(214,180,122,.12);
  color:var(--gold-strong);
  font-size:9px;
}

.mediation-workbench input:not([type="hidden"]),
.mediation-workbench textarea,
.mediation-workbench select{
  background:
    linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.01)),
    #171d27;
}

.mediation-workbench textarea{
  min-height:82px;
  resize:vertical;
}

.med-form-prefilled{
  color:var(--gold-strong);
  background:rgba(214,180,122,.07) !important;
  border-color:rgba(214,180,122,.24) !important;
}

.med-auto-box{
  padding:16px;
  border-radius:20px;
  border:1px solid rgba(214,180,122,.14);
  background:rgba(214,180,122,.05);
}

.med-form-notice{
  padding:18px 20px;
  border-radius:24px;
  border:1px solid rgba(214,180,122,.16);
  background:rgba(214,180,122,.07);
  color:var(--text-2);
  line-height:1.75;
  font-family:'Cormorant Garamond',serif;
  font-size:19px;
}

.med-form-actions{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}

.med-preview-overlay{
  display:none;
  position:fixed;
  inset:0;
  z-index:120;
  padding:24px;
  overflow-y:auto;
  background:rgba(0,0,0,.82);
}

.med-preview-overlay.active{
  display:flex;
  align-items:flex-start;
  justify-content:center;
}

.med-preview-box{
  position:relative;
  width:min(820px,100%);
  margin:28px 0;
  padding:56px 64px;
  border-radius:20px;
  background:#fff;
  color:#000;
  box-shadow:0 24px 80px rgba(0,0,0,.35);
  font-family:'Times New Roman',serif;
  font-size:12pt;
  line-height:1.6;
}

.med-preview-actions{
  position:sticky;
  top:0;
  display:flex;
  justify-content:flex-end;
  gap:8px;
  margin-bottom:18px;
}

.med-preview-action-btn{
  border:none;
  border-radius:12px;
  padding:9px 14px;
  background:#111;
  color:#fff;
  cursor:pointer;
}

.med-preview-action-btn:hover{background:#333}

@media (max-width: 1240px){
  .hero-grid{grid-template-columns:1fr}
  .split{grid-template-columns:1fr}
}

@media (max-width: 1100px){
  .grid-4{grid-template-columns:repeat(2,minmax(0,1fr))}
  .grid-3{grid-template-columns:repeat(2,minmax(0,1fr))}
}

@media (max-width: 960px){
  .auth-panel{grid-template-columns:1fr}
  .auth-side{
    border-right:none;
    border-bottom:1px solid rgba(255,255,255,.06);
  }
  .shell{grid-template-columns:1fr}
  .sidebar{
    position:fixed;
    z-index:70;
    left:0;
    top:0;
    bottom:0;
    width:min(88vw,340px);
    height:100dvh;
    transform:translateX(-105%);
    transition:transform .22s ease;
  }
  .sidebar.open{transform:translateX(0)}
  .backdrop.show{
    display:block;
    position:fixed;
    inset:0;
    z-index:60;
    background:rgba(0,0,0,.48);
  }
  .icon-btn{display:grid}
  .topbar{
    padding:15px 16px;
    align-items:flex-start;
  }
  .topbar-title{font-size:31px}
  .content{padding:18px 16px 92px}
  .mobile-nav{
    display:grid;
    grid-template-columns:repeat(5,1fr);
    gap:8px;
    position:fixed;
    left:12px;
    right:12px;
    bottom:12px;
    z-index:50;
    padding:8px;
    border-radius:24px;
    border:1px solid rgba(255,255,255,.08);
    background:rgba(11,14,21,.92);
    backdrop-filter:blur(18px);
  }
  .mobile-nav button{
    border:none;
    background:transparent;
    color:var(--muted);
    padding:11px 8px;
    border-radius:16px;
    font-size:11px;
  }
  .mobile-nav button.active{
    background:rgba(214,180,122,.10);
    color:var(--gold-strong);
  }
  .med-link-row{grid-template-columns:1fr}
}

@media (max-width: 720px){
  .form-row,
  .grid-2,
  .grid-3,
  .grid-4,
  .hero-foot,
  .kv-row,
  .med-form-row{grid-template-columns:1fr}
  .auth-form{padding:34px 22px 28px}
  .auth-side{padding:30px 22px}
  .auth-mark{font-size:44px}
  .hero{padding:22px}
  .hero h2{font-size:42px}
  .section-title{font-size:27px}
  .doc-intro{
    flex-direction:column;
  }
  .doc-metrics{
    width:100%;
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .med-preview-box{padding:28px 22px}
  .mediation-intro h3{font-size:30px}
}
