@layer base, layout, components, responsive;

@layer base {
  :root {
    font-family: "Anuphan", "Leelawadee UI", Tahoma, sans-serif;
    color: #1f1a33;
    background: #f4f3fa;
    --ink: #1f1a33;
    --muted: #635d7a;
    --surface: #fff;
    --border: #e9e4f4;
    --purple: #5b34e6;
    --purple-ink: #4928b6;
    --purple-wash: #f1ebff;
    --sidebar-width: 222px;
    --topbar-height: 68px;
    --shadow: 0 5px 18px #2a185207;
    font-synthesis: none;
  }

  *, *::before, *::after { box-sizing: border-box; }
  body { margin: 0; font-size: 14px; line-height: 1.5; }
  button, input, select, textarea { font: inherit; }
  button, select, summary { cursor: pointer; }
  button { color: inherit; }
  a { color: inherit; text-decoration: none; }
  img, svg { display: block; }
  svg { flex: none; }
  h1, h2, h3, p { margin: 0; }
  h1 { font-size: clamp(29px, 3vw, 39px); line-height: 1.2; font-weight: 700; }
  h2 { font-size: 19px; line-height: 1.35; }
  h3 { font-size: 16px; }
  :focus-visible { outline: 3px solid #7b5cff; outline-offset: 3px; }
  :disabled { cursor: default; opacity: .55; }
  [hidden] { display: none !important; }
  .pre { white-space: pre-wrap; overflow-wrap: anywhere; }
  .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .skip-link { position: fixed; top: 10px; left: 10px; transform: translateY(-200%); z-index: 10; padding: 10px; background: white; }
  .skip-link:focus { transform: none; }
}

@layer layout {
  .sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 5; width: var(--sidebar-width);
    display: flex; flex-direction: column; padding: 23px 14px 16px;
    color: #d9d1ee; background: #0c0b14;
  }
  .brand { display: flex; align-items: center; gap: 11px; margin: 0 5px 35px; color: #fff; }
  .brand img, .phone-header img { border-radius: 50%; object-fit: cover; }
  .brand img { box-shadow: 0 0 18px #9b82ff43; }
  .brand strong, .brand small, .profile strong, .profile small { display: block; }
  .brand strong { font-size: 18px; line-height: 1.15; }
  .brand small { color: #c9b8ff; font-size: 11px; letter-spacing: .035em; margin-top: 3px; }
  .sidebar nav { display: grid; gap: 5px; }
  .nav-label { margin: 0 10px 2px; color: #a59abf; font-size: 12px; }
  .nav-label:not(:first-child) { margin-top: 22px; }
  .sidebar nav a {
    display: flex; align-items: center; gap: 11px; padding: 10px 11px;
    border: 1px solid transparent; border-radius: 10px; min-height: 44px; font-weight: 500;
  }
  .sidebar nav a:hover, .sidebar nav a[aria-current="page"] { background: #23203a; color: #fff; }
  .sidebar nav a[aria-current="page"] { border-color: #574279; }
  .sidebar nav a[aria-current="page"] svg { color: #bda7ff; }
  .sidebar .count { margin-left: auto; min-width: 22px; border-radius: 6px; background: #3e2b67; color: #eee5ff; text-align: center; font-size: 11px; }
  .profile { display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 11px; border-top: 1px solid #2d2445; }
  .profile strong { color: #fff; }
  .profile small { color: #b7aecb; font-size: 11px; }

  .frame { margin-left: var(--sidebar-width); min-height: 100vh; }
  .topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: var(--topbar-height);
    padding: 10px clamp(18px, 2.8vw, 42px); background: #ffffffde; border-bottom: 1px solid var(--border);
  }
  .breadcrumb, .top-actions, .persona { display: flex; align-items: center; gap: 10px; }
  .breadcrumb { color: var(--muted); }
  .breadcrumb strong { color: var(--ink); }
  .top-actions { gap: 13px; }
  .persona {
    position: relative; border: 1px solid var(--border); padding: 0 10px; border-radius: 9px;
    color: var(--purple-ink); background: white; min-height: 36px; gap: 6px;
  }
  .persona select { appearance: none; border: 0; background: transparent; padding: 6px 20px 6px 32px; margin: 0 -10px 0 -33px; color: var(--ink); }
  .persona > svg { pointer-events: none; }
  .persona > svg:last-child { position: absolute; right: 8px; }
  .main { max-width: 1510px; margin: auto; padding: 25px clamp(18px, 2.8vw, 42px) 42px; }
  .main:focus { outline: none; }
  .stack { display: grid; gap: 17px; align-content: start; min-width: 0; }
  .form-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; align-items: start; }
  .line-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr); gap: 24px; align-items: start; }
}

@layer components {
  .button, .icon-button {
    display: inline-flex; justify-content: center; align-items: center; gap: 8px; padding: 8px 14px;
    min-height: 39px; border: 1px solid transparent; border-radius: 9px;
    background: transparent; font-weight: 600; line-height: 1.4; cursor: pointer;
  }
  .icon-button { padding: 6px; min-height: 34px; min-width: 34px; color: var(--muted); }
  .mobile-nav, .preview-jump { display: none; }
  .primary { color: #fff; background: linear-gradient(135deg, #7352f3, #5b34e6); box-shadow: 0 3px 8px #5b34e624; }
  .primary:hover:enabled, a.primary:hover { background: #4d29ca; }
  .secondary { background: #fff; border-color: #dfd7ef; color: var(--purple-ink); }
  .secondary:hover:enabled, a.secondary:hover, .plain:hover:enabled, a.plain:hover, .icon-button:hover { background: var(--purple-wash); }
  .plain { color: var(--purple-ink); }
  .hero-button { background: #fff; color: #321776; margin-top: 17px; }
  .hero-button:hover { background: #e9dcff; }
  .demo {
    display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
    background: #f2edff; color: #4d2aa6; border-radius: 999px; padding: 4px 10px;
    font-size: 12px; font-weight: 600;
  }
  .demo i, .status i { border-radius: 50%; width: 6px; height: 6px; background: currentColor; }
  .hero {
    position: relative; overflow: hidden; isolation: isolate; min-height: 213px;
    background: linear-gradient(96deg, #1a0d39 3%, #29105271 57%, #12082b06 100%),
      url('/handoff/design/assets/hero-bg.jpg') center 12% / cover, #1b0b3d;
    border-radius: 22px; color: white; padding: 25px 30px;
    box-shadow: 0 8px 22px #28144a23;
  }
  .hero-art {
    position: absolute; right: -10px; top: 50%; transform: translateY(-50%); z-index: -1;
    width: min(39%, 360px); aspect-ratio: 1; object-fit: cover;
    mask-image: radial-gradient(closest-side, #000 73%, transparent 100%); pointer-events: none;
  }
  .hero-date { display: flex; align-items: center; gap: 8px; color: #eadbff; font-weight: 500; font-size: 13px; }
  .hero h1 { margin: 8px 0 5px; font-size: clamp(34px, 4vw, 47px); }
  .hero em { color: #d4bfff; font-family: "Instrument Serif", Georgia, serif; font-weight: 400; font-size: .9em; }
  .hero p { color: #f0e6ff; font-size: 15px; }
  .metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin: 18px 0; }
  .metric {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 11px;
    text-align: left; min-height: 77px; background: var(--surface); border: 1px solid var(--border);
    border-radius: 14px; padding: 12px 13px; box-shadow: var(--shadow);
  }
  .metric:hover, .metric[aria-pressed="true"] { border-color: #cab7f3; }
  .metric > svg { color: #8b7aa6; }
  .metric strong, .metric small { display: block; }
  .metric strong { font-size: 24px; line-height: 1.07; margin-top: 3px; }
  .metric small { font-size: 12px; color: var(--muted); }
  .metric-icon, .notice-icon {
    display: grid; place-items: center; width: 39px; height: 39px; border-radius: 10px;
    background: var(--purple-wash); color: var(--purple-ink); flex: none;
  }
  .metric-icon.blue { background: #e7efff; color: #3557a9; }
  .metric-icon.amber { background: #fff0d2; color: #7f4500; }
  .metric-icon.red { background: #ffe6eb; color: #a82b4e; }
  .panel { background: var(--surface); border: 1px solid var(--border); border-radius: 17px; box-shadow: var(--shadow); min-width: 0; }
  .panel-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px 12px; }
  .panel-top p, .page-title p { color: var(--muted); margin-top: 3px; }
  .filter-tools { display: flex; align-items: center; gap: 8px; }
  .search { display: flex; align-items: center; gap: 8px; color: var(--muted); }
  .search, .select-filter select {
    min-height: 38px; padding: 0 10px; border: 1px solid #e2dced; border-radius: 9px; background: #fdfcff;
  }
  .search input { min-width: 0; width: 149px; font-size: 13px; padding: 5px 0; border: 0; background: transparent; color: var(--ink); }
  .select-filter select { font-size: 13px; color: var(--ink); }
  .tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
  .tabs button {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    min-height: 36px; padding: 6px 11px; border: 1px solid transparent; border-radius: 8px;
    color: var(--muted); background: transparent; font-weight: 600;
  }
  .tabs button:hover, .tabs button.active { color: var(--purple-ink); background: var(--purple-wash); }
  .tabs b { display: grid; place-items: center; min-width: 19px; padding: 0 4px; border-radius: 5px; font-size: 11px; background: #eeebf5; }
  .tabs .active b { background: #ded0ff; }
  .board-tabs { padding: 1px 20px 13px; }
  .table-wrap { overflow-x: auto; border-radius: 0 0 17px 17px; }
  table { width: 100%; border-collapse: collapse; text-align: left; }
  th { background: #faf8fe; color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
  th, td { padding: 10px 9px; border-top: 1px solid #efebf6; }
  th:first-child, td:first-child { padding-left: 20px; }
  th:last-child, td:last-child { padding-right: 14px; }
  td { min-height: 60px; }
  tbody tr:hover { background: #fdfbff; }
  .task-name { font-weight: 700; overflow-wrap: anywhere; }
  .task-name:hover { color: var(--purple-ink); text-decoration: underline; }
  .row-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 9px; color: var(--muted); margin-top: 3px; font-size: 11px; }
  .task-code { color: #502ea6; background: #eee7fa; border-radius: 4px; padding: 1px 5px; font-weight: 700; }
  .priority, .late { color: #a72143; font-weight: 600; }
  .due { white-space: nowrap; font-size: 13px; }
  .assignees, .named-avatar { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; font-size: 13px; }
  .avatar-stack { display: flex; }
  .avatar {
    display: inline-grid; place-items: center; width: 27px; height: 27px; border-radius: 50%;
    background: #e8dcff; color: #4c279c; font-size: 13px; font-weight: 700; flex: none;
  }
  .avatar-stack .avatar + .avatar { margin-left: -6px; border: 1px solid white; }
  .avatar.rose { background: #fae2ef; color: #98315e; }
  .avatar.teal { background: #daf3e9; color: #24654d; }
  .avatar.blue { background: #e0eaff; color: #315284; }
  .profile .avatar { width: 35px; height: 35px; background: #6b4be5; color: #fff; }
  .status {
    display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
    padding: 4px 9px; border-radius: 999px; font-size: 12px; font-weight: 700;
  }
  .status.todo { background: #e9efff; color: #3452a0; }
  .status.in_review { background: #eee6ff; color: #5930a8; }
  .status.changes_requested { background: #fff0d2; color: #7f4500; }
  .status.approved { background: #ddf3e6; color: #1f6b3b; }
  .empty { padding: 38px 20px; text-align: center; color: var(--muted); }
  .empty > span { display: grid; place-items: center; margin: 0 auto 10px; width: 46px; height: 46px; background: var(--purple-wash); color: var(--purple-ink); border-radius: 12px; }
  .empty strong { display: block; color: var(--ink); font-size: 17px; margin-bottom: 4px; }

  .page-title { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; margin: 5px 0 22px; }
  .page-title h1 { overflow-wrap: anywhere; }
  .main > .plain:first-child { margin: -3px 0 7px -8px; }
  .form-card { display: grid; gap: 15px; padding: 20px; }
  .form-card label, .reply-form label { display: block; font-weight: 600; }
  .form-card .required { color: #a72143; }
  .form-card input:not([type=checkbox], [type=radio], [type=file]), .form-card select, .form-card textarea,
  .reply-form input, .reply-form textarea {
    width: 100%; min-height: 42px; padding: 8px 11px; margin-top: 5px; border: 1px solid #dcd3ec;
    border-radius: 9px; background: #fdfcff; color: var(--ink); font-weight: 400;
  }
  textarea { resize: vertical; }
  .form-card fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
  .form-card legend { margin-bottom: 5px; font-weight: 600; }
  .hint { color: var(--muted); font-size: 13px; font-weight: 400; }
  .picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
  .picker label, .choice label {
    display: flex; gap: 7px; align-items: center; padding: 8px; background: #faf8fe;
    border: 1px solid var(--border); border-radius: 9px;
  }
  .picker small, .toggle-row small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
  .picker input, .choice input { accent-color: var(--purple); }
  .choice { display: flex; flex-wrap: wrap; gap: 8px; }
  .choice label { padding: 7px 10px; }
  .choice label:has(input:checked), .picker label:has(input:checked) { border-color: #bca8ef; background: var(--purple-wash); }
  .form-card .toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; }
  .form-card .toggle-row > span:first-child { color: var(--ink); }
  .switch {
    appearance: none; width: 37px; height: 21px; flex: none; border: 1px solid #9f96b3;
    background: #e0dbe9; border-radius: 999px; margin: 0; cursor: pointer; position: relative;
  }
  .switch:checked { background: #6947ec; border-color: #6947ec; }
  .switch::after { content: ""; position: absolute; left: 2px; top: 2px; width: 15px; height: 15px; border-radius: 50%; background: white; box-shadow: 0 1px 3px #332d4c36; }
  .switch:checked::after { transform: translateX(16px); }
  .form-actions, .submission-links, .notice-task-links { display: flex; flex-wrap: wrap; gap: 8px; }
  .form-error { color: #9b1740; font-weight: 600; background: #fce8f0; border-radius: 8px; padding: 8px 10px; }
  .form-card .file-picker { display: grid; justify-items: center; gap: 6px; padding: 17px; border: 1px dashed #b9a6df; border-radius: 12px; background: #faf7ff; color: var(--purple-ink); text-align: center; }
  .file-picker input { max-width: 100%; font-size: 13px; }
  .revision { display: flex; gap: 10px; background: #fff0d2; color: #7f4500; padding: 13px 16px; margin-bottom: 15px; border-radius: 12px; }
  .description { color: var(--muted); }
  .detail-meta dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 11px 13px; }
  .detail-meta dt { color: var(--muted); font-size: 13px; }
  .detail-meta dd { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin: 0; font-weight: 600; }
  .timeline, .submissions { margin: 0; padding: 0; list-style-type: none; display: grid; gap: 12px; }
  .timeline li { border-left: 2px solid #d9ccfc; padding-left: 11px; }
  .timeline strong, .timeline small { display: block; }
  .timeline small, .submission-heading small { color: var(--muted); }
  .timeline p, .submissions p { margin: 5px 0; color: var(--muted); }
  .submissions article { padding: 10px 0; border-top: 1px solid var(--border); }
  .submission-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 7px; }

  .inbox-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 18px; }
  .inbox-items { overflow: hidden; border-radius: 0 0 17px 17px; }
  .inbox-row {
    display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 13px;
    width: 100%; text-align: left; padding: 14px 18px; background: #fff; border: 0; border-top: 1px solid var(--border);
  }
  .inbox-row.unread { background: #faf7ff; }
  .inbox-row.unread .notice-icon { box-shadow: inset 3px 0 #7750e9; }
  .inbox-row:hover { background: #f3edff; }
  .inbox-row:focus-visible { outline-offset: -4px; }
  .inbox-copy strong, .inbox-copy span, .inbox-meta span, .inbox-meta small { display: block; }
  .inbox-copy span, .inbox-meta { color: var(--muted); }
  .inbox-meta { text-align: right; white-space: nowrap; font-size: 12px; }
  .inbox-copy span { font-size: 13px; }

  .line-heading { display: flex; gap: 10px; align-items: center; }
  .line-heading .status { margin-left: auto; }
  .line-heading p, .preview-title small { color: var(--muted); font-size: 13px; }
  .line-mark { background: #087942; color: #fff; border-radius: 10px; width: 43px; height: 43px; display: grid; place-items: center; font-weight: 700; font-size: 12px; }
  .reminder-list { border-top: 1px solid var(--border); }
  .reminder-list .toggle-row { border-bottom: 1px solid var(--border); }
  .clock-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
  .clock-form label { flex: 1 1 165px; }
  .clock-form label > input { margin: 0 !important; }
  .clock-form .form-error { flex-basis: 100%; }
  .line-preview { position: sticky; top: 16px; min-width: 0; scroll-margin-top: 72px; }
  .preview-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 11px; }
  .phone { background: white; border: 7px solid #16102b; border-radius: 26px; overflow: hidden; box-shadow: 0 13px 28px #23104b25; }
  .phone-header, .phone-footer { display: flex; align-items: center; gap: 10px; padding: 11px 13px; }
  .phone-header strong, .phone-header small { display: block; }
  .phone-header small, .phone-footer { color: var(--muted); font-size: 12px; }
  .chat-body { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px; min-height: 330px; max-height: 495px; overflow-y: auto; background: #b2c2dd; }
  .chat-stamp { align-self: center; border-radius: 999px; padding: 2px 9px; font-size: 11px; background: #d0d9ed; color: #334261; }
  .chat-bubble { width: 100%; padding: 10px 11px; background: #fff; border-radius: 4px 13px 13px; }
  .chat-bubble p { margin-top: 4px; color: #3d475a; font-size: 13px; }
  .chat-actions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
  .chat-actions button, .chat-actions a, .chat-link { display: inline-block; font-size: 12px; font-weight: 700; color: #185437; background: #e2f7d8; border: 1px solid #d1edc4; border-radius: 7px; padding: 4px 7px; }
  .chat-link { margin-top: 7px; }
  .chat-actions button:hover, .chat-actions a:hover, .chat-link:hover { background: #beeab0; }
  .chat-empty { margin: auto; display: grid; justify-items: center; gap: 4px; text-align: center; color: #25324e; }
  .reply-form { display: grid; gap: 7px; background: #effbe8; }
  .reply-form .button { min-height: 33px; font-size: 12px; padding: 5px 8px; }
  .preview-note { text-align: center; color: var(--muted); font-size: 12px; margin-top: 10px; }
  .toast {
    position: fixed; z-index: 7; right: 22px; bottom: 22px; max-width: min(385px, calc(100% - 44px));
    border-radius: 12px; background: #241835; color: white; padding: 12px 17px; font-weight: 600; box-shadow: 0 6px 18px #2512384a;
  }
}

@layer responsive {
  @media (max-width: 1120px) {
    :root { --sidebar-width: 195px; }
    .metric { gap: 9px; padding-inline: 9px; }
    .metric > svg { display: none; }
    .metric { grid-template-columns: auto 1fr; }
    .panel-top { flex-wrap: wrap; }
    .line-layout { gap: 16px; }
  }
  @media (max-width: 900px) {
    :root { --sidebar-width: 172px; }
    .sidebar { padding-inline: 10px; }
    .brand { gap: 8px; }
    .brand strong { font-size: 16px; }
    .line-layout { grid-template-columns: minmax(0, 1fr); }
    .preview-jump { display: inline-flex; }
    .line-preview { position: static; max-width: 450px; width: 100%; margin-inline: auto; }
    .picker { grid-template-columns: 1fr; }
    th, td { padding-inline: 6px; }
    th:first-child, td:first-child { padding-left: 13px; }
    th:last-child, td:last-child { padding-right: 8px; }
  }
  @media (max-width: 720px) {
    :root { --topbar-height: 56px; }
    .sidebar { transform: translateX(-100%); width: min(240px, 80vw); top: var(--topbar-height); visibility: hidden; }
    .sidebar.expanded { transform: none; visibility: visible; box-shadow: 12px 0 50px #150d3961; }
    .frame { margin: 0; }
    .topbar { position: sticky; top: 0; z-index: 5; padding-block: 6px; gap: 8px; background: white; }
    .mobile-nav { display: inline-flex; margin-left: -7px; }
    .breadcrumb > span, .breadcrumb > svg { display: none; }
    .top-actions { gap: 6px; }
    .form-grid { grid-template-columns: minmax(0, 1fr); }
    .picker { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .main { padding-top: 16px; }
    .hero { padding: 19px 21px; min-height: 175px; }
    .hero-art { width: 43%; right: -4%; opacity: .8; }
    .hero p { font-size: 13px; }
  }
  @media (max-width: 500px) {
    .top-actions > .demo { display: none; }
    .persona select { max-width: 177px; text-overflow: ellipsis; }
    .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-block: 12px; }
    .metric { min-height: 61px; padding: 8px 10px; }
    .metric strong { font-size: 22px; }
    .metric-icon { width: 34px; height: 34px; }
    .panel-top { padding: 14px 13px 10px; }
    .filter-tools { width: 100%; flex-wrap: wrap; }
    .search { flex: 1; min-width: 150px; }
    .search input { width: 100%; }
    .board-tabs { padding: 0 11px 9px; }
    .tabs button { min-height: 34px; padding: 5px 7px; font-size: 13px; }
    .tabs button b { min-width: 15px; }
    .table-wrap table, .table-wrap tbody { display: block; }
    .table-wrap thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .table-wrap tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; padding: 10px 12px; border-top: 1px solid var(--border); gap: 6px 8px; }
    .table-wrap td { min-height: 0; border: 0; padding: 0; }
    .table-wrap td:first-child { grid-column: 1; grid-row: 1; }
    .table-wrap td:nth-child(2) { grid-column: 1; grid-row: 2; }
    .table-wrap td:nth-child(3) { grid-column: 2; grid-row: 2; align-self: center; text-align: right; }
    .table-wrap td:nth-child(4) { grid-column: 2; grid-row: 1; text-align: right; }
    .table-wrap td:last-child { display: none; }
    .hero-art { opacity: .6; }
    .hero h1 { font-size: 32px; }
    .hero em { display: block; font-size: .75em; }
    .page-title { align-items: flex-start; flex-wrap: wrap; margin-bottom: 16px; }
    .form-card { padding: 16px; }
    .inbox-toolbar { padding: 10px; }
    .inbox-row { grid-template-columns: auto 1fr; gap: 5px 8px; padding: 10px; }
    .inbox-row > svg { display: none; }
    .inbox-meta { grid-column: 2; text-align: left; }
    .inbox-meta small, .inbox-meta span { display: inline; margin-right: 5px; }
    .line-heading { flex-wrap: wrap; }
  }
}


@layer components {
  .auth-page { display: grid; place-content: center; gap: 14px; min-height: 100svh; padding: 22px;
    background: linear-gradient(115deg,#1a0d39 5%,#160a34aa 80%), url('/handoff/design/assets/hero-bg.jpg') center 12%/cover; }
  .auth-page > p { color: white; }
  .auth-card { width: min(420px, calc(100vw - 44px)); padding: 28px; gap: 19px; }
  .auth-brand { display: flex; align-items: center; gap: 10px; }
  .auth-brand img { border-radius: 50%; }
  .auth-brand strong, .auth-brand small { display: block; }
  .auth-brand small { color: var(--muted); }
  .auth-form { display: grid; gap: 12px; }
  .active-user { color: var(--muted); white-space: nowrap; }
  .directory-row { display: grid; gap: 5px; border-bottom: 1px solid var(--border); padding: 8px 0 12px; }
  .directory-row .form-actions { align-items: center; }
  .directory-row .member-enabled { display: flex; gap: 5px; align-items: center; padding: 6px; }
  .connection-code { display: grid; gap: 8px; padding: 11px; border-radius: 9px; background: var(--purple-wash); }
  .line-history { align-self: start; }
}

@layer responsive {
  @media (max-width: 500px) {
    .top-actions .active-user { display: none; }
  }
}
