:root {
  --bg: #ffffff; --card: #ffffff; --ink: #111113; --body: #3a3a40; --mute: #6b6b73;
  --line: #e7e7ea; --surface: #f7f7f8; --signal: #ffd400; --signal-tint: #fff4cc;
  --chip: #ffffff; --shadow: 0 1px 2px rgba(17,17,19,.04), 0 12px 28px -14px rgba(17,17,19,.16);
  --shadow-hover: 0 18px 40px -18px rgba(17,17,19,.28), 0 2px 0 #111113; --hover-border: #111113;
  --glow-a: #fff1b8; --glow-b: #ddf1e6; --ok: #16a34a; --warn: #d97706; --err: #b42318;
  --font: "Hanken Grotesk", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0e10; --card: #17171a; --ink: #f4f4f5; --body: #c9c9cf; --mute: #8e8e96;
    --line: #2a2a2e; --surface: #1f1f23; --chip: #17171a;
    --shadow: 0 12px 28px -14px rgba(0,0,0,.6); --shadow-hover: 0 18px 40px -18px rgba(255,212,0,.25), 0 2px 0 #ffd400; --hover-border: #ffd400;
    --glow-a: rgba(255,212,0,.13); --glow-b: rgba(52,160,110,.16); --err: #f97066;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e0e10; --card: #17171a; --ink: #f4f4f5; --body: #c9c9cf; --mute: #8e8e96;
  --line: #2a2a2e; --surface: #1f1f23; --chip: #17171a;
  --shadow: 0 12px 28px -14px rgba(0,0,0,.6); --shadow-hover: 0 18px 40px -18px rgba(255,212,0,.25), 0 2px 0 #ffd400; --hover-border: #ffd400;
  --glow-a: rgba(255,212,0,.13); --glow-b: rgba(52,160,110,.16); --err: #f97066;
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--body); font-family: var(--font); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; min-height: 100vh; transition: background-color .25s, color .25s; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; border-radius: 6px; }

.glow { position: fixed; inset: 0 0 auto 0; height: 520px; pointer-events: none; z-index: 0;
  background: radial-gradient(900px 420px at 8% -8%, var(--glow-a), transparent 62%), radial-gradient(800px 420px at 96% -4%, var(--glow-b), transparent 60%); }
.wrap { position: relative; z-index: 1; max-width: 1240px; margin: 0 auto; padding: 32px 20px 72px; }

/* top bar */
.top { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.top .left, .top .right { display: flex; align-items: center; gap: 10px; }
.mark { width: 28px; height: 28px; border-radius: 8px; background: #111113; display: inline-grid; place-items: center; flex-shrink: 0; }
:root[data-theme="dark"] .mark { background: #26262a; }
.mark i { width: 10px; height: 10px; background: var(--signal); display: block; }
.mark.lg { width: 40px; height: 40px; border-radius: 12px; }
.mark.lg i { width: 14px; height: 14px; }
.brands { display: flex; gap: 8px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 6px; border: 1px solid var(--line); border-radius: 999px; background: var(--chip); font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.plate { height: 26px; border-radius: 999px; background: #fff; display: inline-grid; place-items: center; flex-shrink: 0; }
.plate img { height: 20px; width: auto; max-width: 90%; display: block; }
.switch { display: inline-flex; gap: 2px; padding: 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.switch button { min-width: 34px; height: 30px; padding: 0 10px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--mute); display: inline-grid; place-items: center; transition: background .2s, color .2s; }
.switch button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(17,17,19,.12); font-weight: 700; }
.menu { position: relative; }
.menu summary, .menu-static { list-style: none; display: inline-flex; align-items: center; gap: 8px; padding: 4px 14px 4px 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--chip); cursor: pointer; }
.menu summary::-webkit-details-marker { display: none; }
.avatar { width: 30px; height: 30px; border-radius: 999px; background: var(--signal); color: #111113; display: inline-grid; place-items: center; font-weight: 800; font-size: 13px; }
.who { font-size: 14px; font-weight: 600; color: var(--ink); }
.menu-list { position: absolute; right: 0; top: calc(100% + 8px); min-width: 200px; padding: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); z-index: 10; display: grid; }
.menu-list a, .menu-list button { display: block; width: 100%; text-align: left; padding: 10px 12px; border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--ink); text-decoration: none; }
.menu-list a:hover, .menu-list button:hover { background: var(--surface); }
.back { font-size: 14px; font-weight: 600; color: var(--mute); text-decoration: none; }
.back:hover { color: var(--ink); }

/* hero */
.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; padding: 56px 0 32px; }
.greet { font-size: 20px; font-weight: 500; color: var(--mute); margin-bottom: 6px; }
h1 { font-size: clamp(48px, 8vw, 88px); font-weight: 800; letter-spacing: -.04em; line-height: .96; color: var(--ink); }
.dot { color: var(--signal); }
.hero-side { display: grid; justify-items: end; gap: 12px; padding-bottom: 6px; max-width: 340px; text-align: right; }
.hero-side p { font-size: 17px; line-height: 1.55; color: var(--body); }
.status { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--mute); }
.status i { width: 8px; height: 8px; border-radius: 999px; background: var(--mute); }
.status.ok i { background: var(--ok); box-shadow: 0 0 0 0 rgba(22,163,74,.5); animation: ping 2.4s infinite; }
.status.warn i { background: var(--warn); }
.sub { font-size: 16px; line-height: 1.55; color: var(--body); margin-top: 10px; }

/* cards */
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.card { position: relative; display: flex; flex-direction: column; gap: 18px; padding: 10px 10px 22px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow);
  transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s, border-color .25s; animation: rise .6s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i) * 70ms); }
.card:hover, .card:focus-within { transform: translateY(-4px); border-color: var(--hover-border); box-shadow: var(--shadow-hover); }
.cover { position: absolute; inset: 0; border-radius: 20px; z-index: 1; }
.preview { height: 150px; border-radius: 14px; background: var(--tint); display: grid; place-items: center; overflow: hidden; }
.preview svg { width: 100%; height: 100%; max-width: 366px; }
.body { display: grid; gap: 8px; padding: 0 14px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.card h2 { font-size: 23px; font-weight: 700; letter-spacing: -.015em; line-height: 1.2; color: var(--ink); }
.go { width: 36px; height: 36px; border-radius: 999px; background: var(--surface); color: var(--ink); display: grid; place-items: center; flex-shrink: 0; transition: background .2s, color .2s, transform .25s; }
.card:hover .go { background: var(--signal); color: #111113; transform: rotate(45deg); }
.card p { font-size: 15px; line-height: 1.53; color: var(--body); min-height: 46px; }
.host { font-size: 13px; font-weight: 500; color: var(--mute); padding-top: 6px; }
.links { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 4px; position: relative; z-index: 2; }
.links a { display: inline-flex; align-items: center; gap: 4px; padding: 6px 13px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--ink); text-decoration: none; background: var(--card); transition: background .2s, border-color .2s, color .2s; }
.links a:hover { background: var(--signal); border-color: var(--signal); color: #111113; }
.empty { padding: 40px; border: 1px dashed var(--line); border-radius: 20px; text-align: center; color: var(--mute); }

/* preview motion */
.draw { stroke-dasharray: 420; stroke-dashoffset: 420; animation: draw 1.4s .3s ease-out forwards; }
.draw-fill { opacity: 0; animation: fade .8s 1.1s forwards; }
.pulse { transform-origin: 330px 44px; transform-box: view-box; animation: pulse 2.4s 1.6s infinite; }
.grow { transform-origin: left center; transform-box: fill-box; animation: grow 1s cubic-bezier(.2,.8,.2,1) both; }
.fill { transform-origin: bottom; transform-box: fill-box; animation: grow-y 1.2s .3s cubic-bezier(.2,.8,.2,1) both; }
.twinkle { transform-origin: center; transform-box: fill-box; animation: twinkle 2.6s infinite; }
.twinkle.late { animation-delay: 1.3s; }
.bob { animation: bob 3s ease-in-out infinite; }
.travel { animation: travel 2.4s ease-in-out infinite; }

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade { to { opacity: 1; } }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.35); } }
@keyframes grow { from { transform: scaleX(0); } }
@keyframes grow-y { from { transform: scaleY(0); } }
@keyframes twinkle { 0%,100% { transform: scale(1) rotate(0); opacity: 1; } 50% { transform: scale(.6) rotate(20deg); opacity: .6; } }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes travel { 0% { transform: translateX(0); } 50% { transform: translateX(44px); } 100% { transform: translateX(0); } }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(22,163,74,.45); } 70%,100% { box-shadow: 0 0 0 8px rgba(22,163,74,0); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .draw { stroke-dashoffset: 0; } .draw-fill { opacity: 1; }
}

/* auth pages */
.auth { position: relative; z-index: 1; min-height: 100vh; display: grid; place-items: center; align-content: center; gap: 24px; padding: 72px 16px 40px; }
.auth-top { position: absolute; top: 20px; right: 20px; display: flex; gap: 10px; }
.auth-card { width: min(440px, 100%); display: grid; gap: 14px; padding: 40px; background: var(--card); border: 1px solid var(--line); border-radius: 24px; box-shadow: 0 1px 2px rgba(17,17,19,.04), 0 30px 60px -30px rgba(17,17,19,.25); animation: rise .5s both; }
.auth-card h1 { font-size: 34px; line-height: 1.12; letter-spacing: -.03em; }
.auth-card .sub { margin-top: 0; }
.form { display: grid; gap: 14px; margin-top: 10px; }
.form label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink); }
.lab-row { display: flex; justify-content: space-between; align-items: center; }
.link { font-size: 13px; font-weight: 500; color: var(--mute); text-decoration: underline; }
input[type="email"], input[type="password"], input[type="text"] { width: 100%; height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; font-size: 15px; transition: border-color .15s, box-shadow .15s, background .15s; }
input:focus { outline: none; border-color: var(--ink); background: var(--card); box-shadow: 0 0 0 4px rgba(255,212,0,.35); }
.pw { position: relative; display: block; }
.pw input { padding-right: 44px; }
.eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; display: grid; place-items: center; color: var(--mute); border-radius: 8px; }
.check { display: flex !important; grid-template-columns: none; align-items: center; gap: 10px; font-weight: 400 !important; font-size: 14px !important; color: var(--body) !important; }
.check input { width: 18px; height: 18px; accent-color: #111113; }
.hint { font-size: 13px; color: var(--mute); }
.error { font-size: 14px; font-weight: 600; color: var(--err); }
.primary { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 50px; padding: 0 22px; border-radius: 14px; background: #111113; color: #fff; font-size: 16px; font-weight: 700; text-decoration: none; box-shadow: 0 2px 0 var(--signal); transition: transform .15s, box-shadow .15s; }
.primary span { color: var(--signal); }
.primary:hover { transform: translateY(-1px); box-shadow: 0 4px 0 var(--signal); }
.primary:active { transform: translateY(1px); box-shadow: 0 1px 0 var(--signal); }
:root[data-theme="dark"] .primary { background: var(--signal); color: #111113; box-shadow: none; }
:root[data-theme="dark"] .primary span { color: #111113; }

/* team */
.team-hero { align-items: flex-end; padding-top: 40px; }
.team-hero h1 { font-size: clamp(40px, 6vw, 56px); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 20px; background: var(--card); box-shadow: var(--shadow); }
.table { min-width: 1000px; }
.tr { display: grid; grid-template-columns: 300px 150px repeat(var(--apps), minmax(90px, 1fr)) 48px; align-items: center; padding: 16px 24px; border-bottom: 1px solid var(--line); }
.tr:last-child { border-bottom: 0; }
.tr.head { background: var(--surface); padding: 14px 24px; font-size: 12px; font-weight: 700; color: var(--ink); }
.tr.head .lbl { letter-spacing: .1em; text-transform: uppercase; color: var(--mute); }
.tr.head .c { text-align: center; }
.tr.off { opacity: .55; }
.person { display: flex; align-items: center; gap: 12px; min-width: 0; }
.person .avatar { width: 38px; height: 38px; font-size: 15px; }
.person b { display: block; font-size: 15px; color: var(--ink); }
.person small { display: block; font-size: 13px; color: var(--mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill { display: inline-flex; padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; color: #111113; background: var(--surface); }
:root[data-theme="dark"] .pill { color: var(--ink); }
.pill.owner { background: var(--signal-tint); color: #111113; }
.pill.invited { background: #ffe8e2; color: #111113; }
.c { display: flex; justify-content: center; }
.toggle { width: 42px; height: 26px; border-radius: 999px; background: var(--line); position: relative; transition: background .2s; }
.toggle::after { content: ""; position: absolute; top: 4px; left: 4px; width: 18px; height: 18px; border-radius: 999px; background: #fff; box-shadow: 0 1px 2px rgba(17,17,19,.25); transition: transform .2s cubic-bezier(.2,.8,.2,1), background .2s; }
.toggle[aria-checked="true"] { background: #111113; }
.toggle[aria-checked="true"]::after { transform: translateX(16px); background: var(--signal); }
:root[data-theme="dark"] .toggle[aria-checked="true"] { background: var(--signal); }
:root[data-theme="dark"] .toggle[aria-checked="true"]::after { background: #111113; }
.toggle:disabled { cursor: not-allowed; opacity: .7; }
.more { position: relative; }
.more summary { list-style: none; width: 36px; height: 36px; border-radius: 999px; display: grid; place-items: center; cursor: pointer; color: var(--mute); }
.more summary::-webkit-details-marker { display: none; }
.more summary:hover { background: var(--surface); color: var(--ink); }

dialog { margin: auto; width: min(480px, calc(100% - 32px)); border: 1px solid var(--line); border-radius: 24px; background: var(--card); color: var(--body); padding: 32px; box-shadow: 0 30px 60px -20px rgba(0,0,0,.4); }
dialog::backdrop { background: rgba(14,14,16,.45); backdrop-filter: blur(3px); }
dialog h2 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); }
.apps-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.apps-pick label { display: inline-flex !important; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; font-weight: 600; cursor: pointer; }
.apps-pick input { accent-color: #111113; }
.role-pick { display: flex; gap: 8px; }
.actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.ghost { height: 50px; padding: 0 18px; border-radius: 14px; font-weight: 600; color: var(--mute); }
.ghost:hover { color: var(--ink); background: var(--surface); }
.linkbox { display: flex; gap: 8px; }
.linkbox input { flex: 1; font-size: 13px; }

/* responsive */
@media (max-width: 1020px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) {
  .wrap { padding: 20px 16px 48px; }
  .top .left .brands { display: none; }
  .who { display: none; }
  .menu summary, .menu-static { padding-right: 4px; }
  .hero { flex-direction: column; align-items: flex-start; gap: 12px; padding: 32px 0 20px; }
  .hero-side { justify-items: start; text-align: left; }
  .greet { font-size: 17px; }
  .grid { grid-template-columns: 1fr; gap: 14px; }
  .card p { min-height: 0; }
  .auth-card { padding: 28px 22px; }
  .auth .brands { justify-content: center; }
  .team-hero { flex-direction: column; align-items: stretch; }
}
@media (max-width: 720px) { .hero .brands-mobile { display: flex; } }
