/* Emerald Vault web app. Same tokens as the site; 8px grid; edges align at 24px. */
[hidden] { display: none !important; }
.defs { position: absolute; width: 0; height: 0; }
.screen[hidden] { display: none; }
svg { width: 18px; height: 18px; }
.brand svg { width: 22px; height: 22px; }
.logo { width: 56px; height: 56px; }

.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 32px; height: 64px; padding: 0 24px; border-bottom: 1px solid var(--line); background: var(--bg); }
.tabs { display: flex; gap: 4px; flex: 1; }
.tab { display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border: 0; text-decoration: none; white-space: nowrap; border-radius: var(--r); background: none; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; }
.tab:hover { color: var(--text); }
.tab.active { background: var(--surface); color: var(--text); }
.who { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; }

.layout { display: grid; grid-template-columns: 248px 1fr; min-height: calc(100vh - 64px); }
.layout.single { grid-template-columns: 1fr; }
.layout[hidden] { display: none; }
.sidebar { padding: 24px 16px; border-right: 1px solid var(--line); }
.side-label { padding: 0 8px 8px; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; }
.vault-link { display: flex; align-items: center; justify-content: space-between; width: 100%; height: 40px; padding: 0 8px; border: 0; border-radius: var(--r); background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.vault-link:hover { background: var(--surface); }
.vault-link.active { background: var(--surface); color: var(--accent); }
.vault-link small { color: var(--muted); font-size: 12px; }
.side-new { display: flex; gap: 4px; margin-top: 12px; }
.side-new input { height: 36px; font-size: 14px; }

.main { padding: 32px 24px 64px; max-width: 1100px; width: 100%; }
.main-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.main-head h2 { font-size: 22px; line-height: 32px; }
.muted { color: var(--muted); font-size: 14px; }
.head-actions { display: flex; gap: 8px; }
.search { margin-top: 24px; height: 40px; }

.table-wrap { margin-top: 16px; border: 1px solid var(--line); border-radius: 12px; overflow-x: auto; background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { height: 40px; padding: 0 16px; text-align: left; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { height: 56px; padding: 0 16px; border-bottom: 1px solid var(--line); white-space: nowrap; max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.clickable:hover td { background: var(--raised); }
.table .right { text-align: right; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table td.actions { text-align: right; overflow: visible; }
.table td.actions > * { vertical-align: middle; }
.cell-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cell-main div { min-width: 0; }
.cell-main b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.cell-main small { display: block; color: var(--muted); font-size: 12px; line-height: 16px; overflow: hidden; text-overflow: ellipsis; }
.avatar { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: var(--r); color: #052e22; font-weight: 700; font-size: 14px; }
.sub2 { display: block; color: var(--muted); font-size: 12px; line-height: 16px; }
.empty { padding: 48px 16px; color: var(--muted); text-align: center; }

.pill { display: inline-flex; align-items: center; height: 22px; padding: 0 10px; border-radius: 11px; font-size: 12px; font-weight: 600; }
.pill.ok { background: rgba(98, 196, 147, .14); color: var(--ok); }
.pill.wait { background: rgba(52, 211, 153, .14); color: var(--accent); }
.pill.off { background: var(--raised); color: var(--muted); }

.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--raised); color: var(--text); }
select { height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); color: var(--text); font: inherit; font-size: 14px; }
textarea { display: block; width: 100%; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); color: var(--text); font: inherit; resize: vertical; outline: none; }
textarea:focus, select:focus { border-color: var(--accent); outline: none; }
input[readonly], textarea[readonly] { color: var(--muted); }

.invite-bar { display: flex; align-items: center; gap: 12px; margin-top: 24px; }
.invite-bar input[type=email] { flex: 1; max-width: 420px; }
.invite-bar.compact { margin-top: 16px; gap: 8px; }
.invite-bar.compact input { height: 36px; font-size: 14px; }
.check { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; cursor: pointer; white-space: nowrap; }
.check input { width: auto; height: auto; accent-color: var(--accent); }
.notice { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding: 12px 12px 12px 16px; border: 1px solid var(--accent); border-radius: var(--r); background: rgba(52, 211, 153, .08); font-size: 14px; }
.notice code { color: var(--accent); }
.notice .row-actions { display: flex; gap: 4px; flex: none; }

/* panels */
.panel { margin: auto; width: min(480px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow-y: auto; padding: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); box-shadow: 0 24px 64px rgba(0, 0, 0, .5); }
.panel::backdrop { background: rgba(5, 8, 14, .6); }
.panel-inner { display: flex; flex-direction: column; gap: 16px; padding: 24px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin: -4px -8px 0 0; }
.panel-head h2 { font-size: 18px; }
.panel-foot { display: flex; justify-content: space-between; gap: 8px; padding-top: 8px; }
.panel-foot .btn.primary { margin-left: auto; }
.control .icon-btn.in { position: absolute; top: 6px; right: 6px; }
.control .in2 { position: absolute; top: 6px; right: 6px; display: flex; }
.control.a2 input { padding-right: 80px; }
.meta-line { color: var(--muted); font-size: 12px; line-height: 18px; }
.meta-line:empty { display: none; }
.btn.danger-text { border-color: transparent; background: none; color: var(--danger); padding: 0 8px; }
.btn.danger-text:hover { background: rgba(236, 122, 122, .1); }
.rename { display: flex; gap: 8px; }
.rename input { height: 36px; font-size: 14px; }
.list { border: 1px solid var(--line); border-radius: var(--r); }
.list-row { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 8px 8px 12px; }
.list-row + .list-row { border-top: 1px solid var(--line); }
.list-row .grow { flex: 1; min-width: 0; }
.list-row b { display: block; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row small { display: block; color: var(--muted); font-size: 12px; line-height: 16px; }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 20; height: 36px; padding: 0 16px; border-radius: 18px; background: var(--text); color: var(--bg); font-size: 14px; font-weight: 600; line-height: 36px; opacity: 0; transform: translate(-50%, 8px); pointer-events: none; transition: opacity .18s, transform .18s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  .topbar { gap: 12px; padding: 0 16px; }
  .topbar .brand span, #who-email { display: none; }
  .main { padding: 24px 16px 48px; }
  .invite-bar { flex-wrap: wrap; }
  .topbar .brand { font-size: 0; gap: 0; }
  .tabs { overflow-x: auto; scrollbar-width: none; }
  .tab { padding: 0 10px; }
  .map-grid { grid-template-columns: 1fr; }
}

.link-btn { align-self: center; padding: 0; border: 0; background: none; color: var(--muted); font: inherit; font-size: 14px; cursor: pointer; }
.link-btn:hover { color: var(--text); }

/* folders & tags */
.side-label.spaced { margin-top: 24px; }
.folder-link { position: relative; }
.folder-link .label { display: flex; align-items: center; gap: 8px; min-width: 0; }
.folder-link .label svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.folder-link .label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-link .tools { display: none; gap: 2px; }
.folder-link:hover .tools { display: flex; }
.folder-link:hover small { display: none; }
.folder-link .tools .icon-btn { width: 24px; height: 24px; }
.folder-link .tools svg { width: 14px; height: 14px; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 8px; }
.tag-chip { height: 26px; padding: 0 10px; border: 1px solid var(--line); border-radius: 13px; background: none; color: var(--muted); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.tag-chip:hover { color: var(--text); }
.tag-chip.active { border-color: var(--accent); color: var(--accent); background: rgba(52, 211, 153, .08); }
.tags-cell { display: flex; gap: 4px; flex-wrap: nowrap; overflow: hidden; }
.tag-mini { flex: none; height: 20px; padding: 0 8px; border-radius: 10px; background: var(--raised); color: var(--muted); font-size: 11px; font-weight: 600; line-height: 20px; }
.filter-note { display: flex; align-items: center; gap: 8px; margin-top: 12px; color: var(--muted); font-size: 13px; }

/* recovery kit */
.kit-key { padding: 16px; border: 1px solid var(--accent); border-radius: var(--r); background: rgba(52, 211, 153, .06); color: var(--accent); font-size: 17px; line-height: 28px; letter-spacing: .5px; text-align: center; word-spacing: 4px; user-select: all; }
#recover-form h2 { font-size: 18px; }

/* import */
.panel.wide { width: min(760px, calc(100vw - 32px)); }
.drop { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 40px 24px; border: 2px dashed var(--line); border-radius: 12px; text-align: center; cursor: pointer; }
.drop:hover, .drop.over { border-color: var(--accent); background: rgba(52, 211, 153, .05); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.map-grid { display: grid; grid-template-columns: 200px 1fr; gap: 8px 16px; align-items: center; font-size: 14px; color: var(--muted); }
.table-wrap.preview { margin-top: 0; max-height: 220px; overflow: auto; }
.table-wrap.preview td, .table-wrap.preview th { height: 36px; font-size: 13px; }

.map-grid input { height: 36px; font-size: 14px; }

/* move or share */
.section-h { margin: 8px 0 0; font-size: 14px; font-weight: 700; }
#move-form .invite-bar select { flex: 1; }
#move-newvault { height: 36px; font-size: 14px; }

/* pages: import, account */
.main.narrow { max-width: 808px; }
.sheet { display: flex; flex-direction: column; gap: 16px; margin-top: 24px; padding: 24px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.sheet h3 { font-size: 16px; line-height: 24px; font-weight: 600; }
.sheet h3 + .muted { margin-top: 4px; }
.sheet-row { flex-direction: row; align-items: center; justify-content: space-between; }
.sheet-row .row-actions { display: flex; gap: 8px; flex: none; }
.sheet-row > .btn { flex: none; }
.form-narrow { max-width: 400px; }
.form-narrow input { height: 40px; }
@media (max-width: 760px) {
  .sheet-row { flex-direction: column; align-items: flex-start; }
  #lock-btn { display: none; } /* Lock is on the Account page; the tabs need the room */
}

/* per-member permissions: Add / Update / Delete toggles */
.perms { display: inline-flex; gap: 6px; flex: none; }
.perm { height: 28px; padding: 0 12px; border: 1px solid var(--line); border-radius: 14px; background: none; color: var(--muted); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.perm:hover:not(:disabled) { color: var(--text); }
.perm.on { border-color: var(--accent); background: rgba(52, 211, 153, .1); color: var(--accent); }
.perm:disabled { cursor: default; }
.perm-line { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: -4px; font-size: 13px; }
.list-row .grow .perms { display: flex; margin-top: 8px; }

/* saved usernames, addresses and passwords show masked; typing replaces them */
input.masked::placeholder { color: var(--text); opacity: 1; }
input.masked:focus::placeholder { color: var(--muted); }

/* one-time codes */
.otp-live { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 6px 0 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--raised); }
.otp-code { flex: 1; color: var(--accent); font-size: 20px; font-weight: 700; letter-spacing: 2px; }
.otp-ring { width: 18px; height: 18px; flex: none; transform: rotate(-90deg); }
.otp-ring circle { fill: none; stroke: var(--line); stroke-width: 3; }
.otp-ring .otp-left { stroke: var(--accent); stroke-dasharray: 50.27; transition: stroke-dashoffset .9s linear; }

/* password history and trash */
#it-history .list-row { min-height: 44px; }
.days-left { color: var(--muted); font-size: 12px; }

/* two-step sign-in */
#tfa-sheet .sheet-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.tfa-qr img { display: block; width: 180px; height: 180px; padding: 8px; border-radius: 10px; background: #fff; }
.backup-grid { display: grid; grid-template-columns: repeat(2, max-content); gap: 8px 32px; font-size: 15px; }
.row-btns { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 760px) { #tfa-sheet .sheet-row { flex-direction: column; align-items: flex-start; } }

/* signed-in devices */
#sessions-list .list-row b { display: flex; align-items: center; gap: 8px; }
.sheet > .sheet-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

/* errors (admins) */
.spaced-head { margin-top: 40px; }
#errors-table td.msg { white-space: normal; max-width: 560px; }
#errors-table td.msg small { display: block; color: var(--muted); font-size: 12px; white-space: pre-wrap; }
.tab .dot { display: inline-block; width: 7px; height: 7px; margin-left: 6px; border-radius: 50%; background: var(--danger); vertical-align: middle; }

/* Emerald OS: app breadcrumb in the top bar and the home screen of app cards. */
.crumb { margin-left: -16px; padding-left: 16px; border-left: 1px solid var(--line); color: var(--muted); font-weight: 600; white-space: nowrap; }
.topbar .tabs:not(:has(.tab:not([hidden]))) { visibility: hidden; }
.main.home { max-width: 1048px; margin: 0 auto; padding-top: 48px; }
.home-head h2 { font-size: 28px; line-height: 36px; font-weight: 700; letter-spacing: -.2px; }
.home-head .muted { margin-top: 4px; font-size: 15px; }
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-top: 32px; }
.app-card { position: relative; display: flex; flex-direction: column; gap: 8px; min-height: 216px; padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); text-decoration: none; transition: border-color .15s, background .15s, transform .15s; }
.app-card:hover { border-color: var(--accent); background: var(--raised); transform: translateY(-2px); }
.app-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.app-icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 8px; border-radius: 12px; background: var(--raised); color: var(--accent); }
.app-icon svg { width: 26px; height: 26px; }
.app-card:hover .app-icon { background: var(--bg); }
.app-name { font-size: 18px; line-height: 24px; font-weight: 700; }
.app-desc { color: var(--muted); font-size: 14px; line-height: 20px; }
.app-meta { margin-top: auto; padding-top: 8px; color: var(--muted); font-size: 13px; line-height: 20px; min-height: 28px; }
.soon { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--raised); color: var(--muted); font-size: 12px; font-weight: 600; }
.app-go { position: absolute; top: 24px; right: 24px; color: var(--muted); transition: color .15s, transform .15s; }
.app-card:hover .app-go { color: var(--accent); transform: translateX(2px); }
@media (max-width: 720px) {
  .topbar { gap: 16px; padding: 0 16px; overflow-x: auto; }
  .crumb { display: none; }
  .main.home { padding: 32px 16px 48px; }
}

/* ---- Look (see site.css): frosted top bar, panels and sheets; softer corners ---- */
.topbar { height: 68px; background: rgba(14, 15, 18, .62); }
.topbar .brand { font-size: 12px; }
.crumb { font-weight: 500; }
.tab { height: 38px; border-radius: 999px; font-weight: 500; }
.tab.active { background: rgba(255, 255, 255, .08); }
.layout, .layout.single { min-height: calc(100vh - 68px); }
.sidebar { background: rgba(14, 15, 18, .35); }
.vault-link { border-radius: var(--r-sm); }
.vault-link.active, .vault-link:hover { background: rgba(255, 255, 255, .06); }
.main-head h2 { font-size: 28px; line-height: 36px; font-weight: 500; letter-spacing: -.02em; }
.search { height: 48px; }
.table-wrap, .sheet, .list { border-radius: var(--r); background: var(--glass); box-shadow: var(--elevation); }
.list { background: transparent; box-shadow: none; }
.sheet h3 { font-weight: 600; }
.panel { border-radius: 20px; background: var(--glass-strong); box-shadow: var(--elevation), 0 24px 64px rgba(0, 0, 0, .5); }
.panel::backdrop { background: rgba(0, 0, 0, .55); }
.panel-head h2 { font-size: 20px; font-weight: 600; }
.notice, .kit-key, .otp-live, .cmd-box { border-radius: var(--r); }
.invite-bar input[type=email] { height: 44px; }
.icon-btn { border-radius: var(--r-sm); }
.avatar { border-radius: var(--r-sm); }
.toast { height: 40px; border-radius: 999px; line-height: 40px; }

/* home: big greeting and glass app cards */
.home-head h2 { font-size: 42px; line-height: 1.05; font-weight: 500; letter-spacing: -.02em; }
.home-head .muted { margin-top: 12px; font-size: 17px; line-height: 28px; }
.app-grid { gap: 20px; margin-top: 40px; }
.app-card { min-height: 232px; padding: 28px; border-radius: 20px; background: var(--glass); box-shadow: var(--elevation); }
.app-card:hover { background: rgba(34, 36, 42, .7); box-shadow: inset 0 0 0 1px rgba(52, 211, 153, .25), 0 12px 32px rgba(0, 0, 0, .35); }
.app-icon { width: 52px; height: 52px; border-radius: var(--r); background: rgba(52, 211, 153, .1); }
.app-name { font-size: 20px; line-height: 28px; font-weight: 600; letter-spacing: -.01em; }
.app-desc { font-size: 15px; line-height: 22px; }
.app-go { top: 28px; right: 28px; }
@media (max-width: 720px) { .home-head h2 { font-size: 34px; } }
@media (max-width: 760px) {
  .topbar .brand { font-size: 11px; gap: 8px; letter-spacing: .24em; }
}

/* ---- top-bar icons and the app dock (King of Names style) ---- */
.who { gap: 4px; }
.top-icon { width: 40px; height: 40px; border-radius: 999px; color: var(--muted); }
.top-icon svg { width: 20px; height: 20px; }
.top-icon:hover { background: rgba(255, 255, 255, .08); color: var(--text); }
@media (max-width: 760px) { #lock-btn { display: inline-grid; } }

.dock { position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 6; display: flex; gap: 4px; padding: 8px; transform: translateX(-50%); border: 1px solid var(--line); border-radius: 28px; background: rgba(22, 24, 29, .72); box-shadow: var(--elevation), 0 16px 40px rgba(0, 0, 0, .45); }
.dock a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 88px; height: 60px; border-radius: 20px; color: var(--muted); font-size: 12px; font-weight: 500; text-decoration: none; transition: color .15s, background .15s; }
.dock a svg { width: 22px; height: 22px; }
.dock a:hover { color: var(--text); }
.dock a.active { color: var(--text); background: rgba(255, 255, 255, .07); font-weight: 600; }
.dock a.active svg { color: var(--accent); }
#app-screen .layout { padding-bottom: 112px; }
#app-screen .sidebar { margin-bottom: -112px; padding-bottom: 136px; }
@media (max-width: 480px) { .dock { left: 16px; right: 16px; transform: none; justify-content: space-between; } .dock a { flex: 1; width: auto; } }

/* home: big question headline, like King of Names' main screen */
.main.home { padding-top: 88px; }
.home-head h2 { font-size: 48px; line-height: 1.05; letter-spacing: -.025em; max-width: 640px; }
@media (max-width: 720px) { .main.home { padding-top: 56px; } .home-head h2 { font-size: 38px; } }
/* icon buttons: round, like King of Names' Scan card / Photo buttons */
.icon-btn { border-radius: 999px; }
.top-icon { border: 1px solid var(--line); background: rgba(255, 255, 255, .06); color: var(--text); }
.top-icon:hover { background: rgba(255, 255, 255, .12); }
.topbar { background: rgba(14, 15, 18, .7); }
.app-icon { border: 1px solid var(--line); background: rgba(255, 255, 255, .06); border-radius: 999px; }
.app-card:hover { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16), 0 12px 32px rgba(0, 0, 0, .45); }
.tab.active { background: rgba(255, 255, 255, .1); }
.perm.on, .tag-chip.active { background: rgba(52, 211, 153, .1); }
.toast { background: var(--primary); color: var(--on-primary); }

/* loading screen while a reload restores your session */
.boot { position: fixed; inset: 0; display: grid; place-items: center; }
.boot .logo { width: 44px; height: 44px; color: var(--accent); animation: boot-pulse 1.4s ease-in-out infinite; }
@keyframes boot-pulse { 0%, 100% { opacity: .35; transform: scale(.94); } 50% { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .boot .logo { animation: none; } }

/* ---- Settings: heading, underlined tabs with icons and counts, then the open tab ---- */
.main.settings { max-width: 1104px; margin: 0 auto; padding-top: 48px; }
.settings-head h2 { font-size: 34px; line-height: 40px; font-weight: 600; letter-spacing: -.02em; }
.settings-head .muted { margin-top: 8px; font-size: 15px; line-height: 24px; }
.settings-tabs { display: flex; gap: 28px; margin-top: 28px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.settings-tabs a { position: relative; display: inline-flex; align-items: center; gap: 8px; height: 44px; color: var(--muted); font-size: 15px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.settings-tabs a svg { width: 17px; height: 17px; }
.settings-tabs a:hover { color: var(--text); }
.settings-tabs a.active { color: var(--text); }
.settings-tabs a.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); }
.settings-tabs .count { min-width: 22px; height: 18px; padding: 0 6px; border-radius: 9px; background: rgba(52, 211, 153, .14); color: var(--accent); font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.settings-tabs .count:empty { display: none; }
.settings-tabs .dot { margin-left: 0; }
.settings-pane { padding-top: 24px; }
.settings-pane .tab-sub { margin-bottom: 4px; }
.settings-pane > .sheet:first-of-type, .settings-pane > .invite-bar:first-of-type { margin-top: 16px; }
.narrow-col { max-width: 808px; }
@media (max-width: 720px) { .main.settings { padding-top: 32px; } .settings-head h2 { font-size: 28px; } .settings-tabs { gap: 20px; } }

/* access panel: one section per app */
.access-app { display: flex; flex-direction: column; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: var(--r); background: rgba(255, 255, 255, .03); }
.access-app-head { display: flex; align-items: center; gap: 12px; }
.access-app-head b { display: block; font-size: 15px; font-weight: 600; }
.access-app-head small { display: block; color: var(--muted); font-size: 13px; line-height: 18px; }
.app-icon.sm { width: 36px; height: 36px; margin: 0; flex: none; }
.app-icon.sm svg { width: 18px; height: 18px; }
.access-app .perms { flex-wrap: wrap; }
.access-app .perm { height: 32px; padding: 0 14px; font-size: 13px; }
.access-sub-head { margin-top: 4px; }
.access-sub-head b { display: block; font-size: 13px; font-weight: 600; }
.access-sub-head small { display: block; color: var(--muted); font-size: 12px; line-height: 18px; }

/* ---- Wide screens: everything sits in a centred column (max 1440px) ---- */
:root { --page-max: 1440px; --gutter: max(24px, calc((100vw - var(--page-max)) / 2 + 24px)); }
.topbar { padding-left: var(--gutter); padding-right: var(--gutter); }
#app-screen .layout { width: 100%; max-width: var(--page-max); margin-left: auto; margin-right: auto; }
.layout.single > .main { margin-left: auto; margin-right: auto; }
#vaults-page > .main { max-width: none; }
@media (min-width: 1489px) {
  #vaults-page { border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
}
@media (max-width: 760px) { .topbar { padding-left: 16px; padding-right: 16px; } }
.toast { bottom: 108px; } /* above the dock */

/* ---- Full width: pages use the whole screen (replaces the centred 1440px column) ---- */
:root { --page-max: none; --gutter: 24px; }
#app-screen .layout { max-width: none; }
.main.home, .main.settings { max-width: none; margin: 0; padding-left: 40px; padding-right: 40px; }
.narrow-col { max-width: 880px; }
#vaults-page { border-left: 0; border-right: 0; }
@media (max-width: 720px) { .main.home, .main.settings { padding-left: 16px; padding-right: 16px; } }

/* ---- user menu (top right) ---- */
.user-menu { position: relative; }
.user-btn { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 1px solid var(--line); border-radius: 999px; background: rgba(52, 211, 153, .14); color: var(--accent); font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
.user-btn:hover, .user-btn[aria-expanded="true"] { background: rgba(52, 211, 153, .24); }
.menu { position: absolute; top: calc(100% + 8px); right: 0; z-index: 10; width: 260px; padding: 6px; border: 1px solid var(--line); border-radius: 16px; background: var(--glass-strong); box-shadow: var(--elevation), 0 18px 48px rgba(0, 0, 0, .5); }
.menu-head { display: flex; align-items: center; gap: 12px; padding: 10px 10px 12px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.menu-head b { display: block; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
.menu-head small { display: block; color: var(--muted); font-size: 12px; }
.menu-head small:empty { display: none; }
.avatar-lg { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 999px; background: rgba(52, 211, 153, .14); color: var(--accent); font-weight: 700; }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; width: 100%; height: 40px; padding: 0 10px; border: 0; border-radius: 10px; background: none; color: var(--text); font: inherit; font-size: 14px; font-weight: 500; text-align: left; text-decoration: none; cursor: pointer; }
.menu a svg, .menu button svg { width: 18px; height: 18px; color: var(--muted); }
.menu a:hover, .menu button:hover { background: rgba(255, 255, 255, .07); }

/* ---- Settings → Email ---- */
.smtp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.smtp-grid .wide { grid-column: 1 / -1; }
.smtp-grid input, .smtp-grid select { height: 44px; width: 100%; }
@media (max-width: 720px) { .smtp-grid { grid-template-columns: 1fr; } }
.settings-tabs .count.off { background: rgba(255, 255, 255, .08); color: var(--muted); }
.notice.bad { border-color: var(--danger); background: rgba(240, 138, 138, .08); }
.warn-box { padding: 12px 14px; border: 1px solid rgba(240, 190, 110, .35); border-radius: var(--r); background: rgba(240, 190, 110, .07); color: var(--text); font-size: 14px; line-height: 21px; }
.auth .check { color: var(--text); font-size: 15px; }
.row-btns { align-items: center; }

/* ---- Width: a centred column by default; the top-right toggle (html.wide) makes every
   page full width. The home screen stays centred either way. ---- */
:root { --page-max: 1440px; --gutter: max(24px, calc((100vw - var(--page-max)) / 2 + 24px)); }
html.wide { --page-max: 100vw; --gutter: 24px; }
.topbar { padding-left: var(--gutter); padding-right: var(--gutter); }
#app-screen .layout { width: 100%; max-width: var(--page-max); margin-left: auto; margin-right: auto; }
.main.home { width: 100%; max-width: 1200px; margin-left: auto; margin-right: auto; }
html:not(.wide) .main.settings { max-width: none; }
@media (min-width: 1489px) {
  html:not(.wide) #vaults-page { border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
}
@media (max-width: 760px) { .topbar { padding-left: 16px; padding-right: 16px; } #width-btn { display: none; } }

/* ---- Project Management: the 40K View (the board Cameron designed), in Emerald OS's own
   type and surfaces: Plus Jakarta Sans, sentence case, glass cards, pill buttons ---- */
:root { --amber: #ffb547; --sky: #5ab0ff; }
.main.pm { max-width: none; padding: 48px 40px 140px; }
.pm-label { color: var(--muted); font-size: 13px; line-height: 20px; font-weight: 600; }

.pm-alt { color: var(--muted); font-size: 14px; }
.pm-title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; margin-top: 8px; }
.pm-head h1 { margin: 0; font-size: 48px; line-height: 1.05; font-weight: 500; letter-spacing: -.025em; }
.pm-head h1 em { font-style: normal; color: var(--accent); }
.pm-read { max-width: 44ch; color: var(--muted); font-size: 14px; line-height: 22px; text-align: right; }
.pm-read b { color: var(--text); font-weight: 600; }
.pm-read b.amber { color: var(--amber); }
.pm-read b.late { color: var(--danger); }
.pm-bar { display: flex; height: 10px; margin-top: 28px; border-radius: 999px; overflow: hidden; background: rgba(255, 255, 255, .06); }
.pm-bar i { display: block; height: 100%; transition: width .4s; }
.pm-key { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 14px; }
.pm-key span { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.pm-key b { color: var(--text); font-size: 20px; font-weight: 600; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }

/* new task */
.pm-compose { margin-top: 32px; padding: 24px; border: 1px solid var(--line); border-radius: 20px; background: var(--glass); box-shadow: var(--elevation); }
.pm-compose > .pm-label { color: var(--text); font-size: 16px; line-height: 24px; }
.pm-compose-row { display: flex; gap: 12px; margin-top: 16px; }
.pm-compose-row.bottom { align-items: flex-end; }
.pm-compose-row.bottom .field { flex: 1; max-width: 420px; gap: 8px; }
.pm-compose-row.bottom select { width: 100%; height: 48px; }
.pm-compose .field label.pm-label { color: var(--text); font-size: 14px; font-weight: 500; }
.pm-compose textarea { flex: 1; min-height: 76px; font-size: 16px; line-height: 24px; border-radius: var(--r); }
.pm-mic { display: grid; place-items: center; width: 76px; flex: none; border: 1px solid var(--line); border-radius: var(--r); background: rgba(52, 211, 153, .14); color: var(--accent); cursor: pointer; }
.pm-mic svg { width: 26px; height: 26px; }
.pm-mic:hover { background: rgba(52, 211, 153, .24); }
.pm-mic:disabled { opacity: .4; cursor: not-allowed; }
.pm-ai-row { display: flex; align-items: center; gap: 12px; margin-top: 10px; padding-left: 88px; }
.pm-ai-row .btn { color: var(--accent); }
@media (max-width: 640px) { .pm-ai-row { padding-left: 0; } }
.pm-mic.on { background: var(--accent); color: var(--on-accent); animation: pm-listen 1.2s ease-in-out infinite; }
@keyframes pm-listen { 0%, 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, .5); } 50% { box-shadow: 0 0 0 10px rgba(52, 211, 153, 0); } }
.pm-status { margin-top: 12px; color: var(--muted); font-size: 13px; min-height: 20px; }

/* lanes: board section × status */
.pm-lanes-wrap { margin-top: 24px; padding: 24px; border: 1px solid var(--line); border-radius: 20px; background: var(--glass); box-shadow: var(--elevation); }
.pm-lanes-wrap[hidden], .pm-lanes-scroll[hidden] { display: none; }
.pm-lanes-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.pm-lanes-head h2 { font-size: 22px; line-height: 28px; font-weight: 600; letter-spacing: -.01em; }
.pm-lanes-head .pm-label { font-weight: 400; }
.pm-lanes-scroll { overflow-x: auto; }
.pm-lanes { display: grid; grid-template-columns: 160px repeat(4, minmax(200px, 1fr)); gap: 10px; min-width: 960px; }
.pm-lh { display: flex; align-items: center; gap: 8px; padding: 0 4px 4px; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; }
.pm-lh b { color: var(--text); }
.pm-area { padding: 12px 6px; font-size: 15px; line-height: 22px; font-weight: 600; overflow-wrap: anywhere; }
.pm-cell { display: flex; flex-direction: column; gap: 8px; min-height: 112px; padding: 8px; border: 1px dashed transparent; border-radius: 14px; background: rgba(255, 255, 255, .03); transition: border-color .15s, background .15s; }
.pm-cell.over { border-color: var(--accent); background: rgba(52, 211, 153, .06); }
.pm-card { position: relative; padding: 12px 12px 12px 15px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, .055); box-shadow: inset 3px 0 0 var(--sc), 0 8px 20px -12px rgba(0, 0, 0, .7); cursor: pointer; transition: transform .12s, border-color .12s, background .12s; }
.pm-card[draggable="true"] { cursor: grab; }
.pm-card:hover { transform: translateY(-1px); border-color: rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .08); }
.pm-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pm-card.dragging { opacity: .45; }
.pm-card.done { opacity: .55; }
.pm-card.done h4 { text-decoration: line-through; text-decoration-thickness: 1px; }
.pm-card.flash { animation: pm-flash 1.8s ease-out; }
@keyframes pm-flash { 0% { box-shadow: inset 3px 0 0 var(--sc), 0 0 0 3px rgba(52, 211, 153, .8); } 100% { box-shadow: inset 3px 0 0 var(--sc), 0 0 0 3px rgba(52, 211, 153, 0); } }
.pm-card-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.pm-due { color: var(--muted); font-size: 12px; }
.pm-due.late { color: var(--danger); font-weight: 600; }
.pm-cyc { height: 24px; padding: 0 10px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, .05); color: var(--text); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.pm-cyc:hover { border-color: var(--accent); color: var(--accent); }
.pm-card h4 { margin: 6px 0 4px; font-size: 16px; line-height: 22px; font-weight: 600; letter-spacing: -.01em; overflow-wrap: anywhere; }
.pm-next { color: var(--muted); font-size: 13px; line-height: 19px; }
.pm-next b { color: var(--sky); font-weight: 600; font-size: 12px; }
.pm-prog { height: 4px; margin-top: 10px; border-radius: 4px; overflow: hidden; background: rgba(255, 255, 255, .1); }
.pm-prog i { display: block; height: 100%; background: var(--accent); }
.pm-flag { margin-top: 8px; color: var(--amber); font-size: 12px; font-weight: 600; }
.pm-empty { margin-top: 24px; padding: 48px 16px; border: 1px dashed var(--line); border-radius: 20px; color: var(--muted); text-align: center; }

.pm-principles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 24px; }
.pm-principles > div { padding: 18px 20px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255, 255, 255, .03); }
.pm-principles .pm-label { color: var(--text); font-size: 14px; }
.pm-principles p { margin-top: 4px; color: var(--muted); font-size: 14px; line-height: 21px; }

/* task panel */
.pm-title-input { flex: 1; height: auto; padding: 0; border: 0; background: none; font-size: 22px; line-height: 30px; font-weight: 600; letter-spacing: -.01em; }
.pm-title-input:focus { box-shadow: none; }
.pm-saved { color: var(--muted); font-size: 13px; align-self: center; }

@media (max-width: 900px) {
  .main.pm { padding: 32px 16px 140px; }
  .pm-title-row { flex-direction: column; align-items: flex-start; gap: 12px; }
  .pm-head h1 { font-size: 38px; }
  .pm-read { text-align: left; }
  .pm-principles { grid-template-columns: 1fr; }
  .pm-compose-row.bottom { flex-direction: column; align-items: stretch; }
  .pm-compose-row.bottom .field { max-width: none; }
}
.pm-lanes-wrap .pm-empty { margin: 0 0 16px; padding: 14px 16px; border-radius: 14px; font-size: 14px; }

/* ---- Popups open instantly: no blur behind or inside them ---- */
.panel { background: var(--surface); }
.panel::backdrop { background: rgba(0, 0, 0, .62); }

/* ---- Project Management: + button, New task popup, task popup ---- */
.pm-head-right { display: flex; align-items: flex-end; gap: 20px; }
.pm-new { display: grid; place-items: center; width: 56px; height: 56px; flex: none; border: 0; border-radius: 999px; background: var(--accent); color: var(--on-accent); cursor: pointer; box-shadow: 0 8px 24px -8px rgba(52, 211, 153, .6); }
.pm-new svg { width: 26px; height: 26px; }
.pm-new:hover { background: var(--accent-hover); }
.pm-new:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.panel.pm-add-modal { width: min(980px, calc(100vw - 32px)); }
.pm-add-modal .pm-compose { margin: 0; padding: 24px; border: 0; border-radius: 0; background: none; box-shadow: none; }
.pm-add-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -4px -8px 0 0; }
.pm-add-head .pm-label { color: var(--text); font-size: 18px; line-height: 26px; }
.pm-compose-row.bottom .field { max-width: none; }

.panel.pm-modal { width: min(1180px, calc(100vw - 32px)); padding: 0; overflow: hidden; }
.pm-modal-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); min-height: 440px; }
.pm-poster { position: relative; display: flex; flex-direction: column; overflow: hidden; background: #0a0f1c; }
.pm-vis, .pm-vis svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.pm-poster::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10, 15, 28, .92) 0%, rgba(10, 15, 28, .55) 55%, rgba(10, 15, 28, .1) 100%); pointer-events: none; }
.pm-poster-body, .pm-chips { position: relative; z-index: 1; }
.pm-poster-body { padding: 28px 28px 0; }
.pm-kicker { color: var(--sky); font-size: 13px; font-weight: 600; }
.pm-poster .pm-title-input { display: block; width: 100%; margin-top: 8px; padding: 0; border: 0; border-radius: 0; background: none; color: #fff; font: inherit; font-size: 34px; line-height: 40px; font-weight: 600; letter-spacing: -.02em; resize: none; overflow: hidden; }
.pm-poster .pm-title-input:focus { box-shadow: none; outline: none; }
.pm-big { display: flex; align-items: baseline; gap: 10px; margin-top: 14px; }
.pm-big b { color: var(--accent); font-size: 48px; line-height: 1; font-weight: 700; letter-spacing: -.02em; }
.pm-big span { color: #c9cdd6; font-size: 15px; font-weight: 600; }
.pm-poster-sub { display: flex; align-items: center; gap: 8px; margin-top: 12px; color: #a7abb4; font-size: 14px; }
.pm-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding: 24px 28px 26px; }
.pm-chip { display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border: 1px solid; border-radius: 999px; font-size: 12px; font-weight: 600; }
.pm-chip.st { border-color: var(--sc); background: color-mix(in srgb, var(--sc) 20%, transparent); color: #fff; }
.pm-chip.warn { border-color: rgba(255, 181, 71, .7); color: var(--amber); }
.pm-chip.hot { border-color: transparent; background: var(--danger); color: #2a0a0a; }

.pm-notes { display: flex; flex-direction: column; gap: 14px; padding: 22px 24px 20px; min-width: 0; }
.pm-notes-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-right: -8px; }
.pm-notes-head .pm-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-notes .field { gap: 6px; }
.pm-notes .field label { font-size: 13px; color: var(--muted); }
.pm-notes #pmf-note { min-height: 84px; }
.pm-notes-foot { display: flex; align-items: center; gap: 12px; margin-top: auto; }
.pm-meta { flex: 1; color: var(--muted); font-size: 13px; }
.pm-finish { height: 38px; padding: 0 18px; border: 1px solid var(--accent); border-radius: 999px; background: none; color: var(--accent); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.pm-finish:hover { background: var(--accent); color: var(--on-accent); }
.pm-finish:disabled { opacity: .5; cursor: default; }

.pm-area { display: flex; align-items: flex-start; justify-content: space-between; gap: 4px; }
.pm-area .icon-btn { width: 26px; height: 26px; flex: none; opacity: 0; }
.pm-area .icon-btn svg { width: 14px; height: 14px; }
.pm-area:hover .icon-btn, .pm-area .icon-btn:focus-visible { opacity: 1; }
@media (hover: none) { .pm-area .icon-btn { opacity: .7; } }
.pm-lanes-head #pm-add-section { margin-left: auto; }
.pm-lanes-head .pm-label { margin-left: auto; }
.pm-lanes-head .pm-label + #pm-add-section { margin-left: 0; }

@media (max-width: 860px) {
  .pm-modal-grid { grid-template-columns: 1fr; }
  .pm-poster { min-height: 300px; }
  .pm-head-right { width: 100%; justify-content: space-between; }
}
.pm-add-modal .pm-status:empty { min-height: 0; margin-top: 0; }

/* ---- Speed: no blur anywhere (it re-renders everything behind it on every scroll),
   so translucent surfaces get a little more body instead ---- */
:root { --glass: rgba(255, 255, 255, .045); --glass-strong: #1a1c21; }
.topbar { background: rgba(14, 15, 18, .94); }
.dock { background: #17191e; }
.menu { background: #1a1c21; }
.panel { background: var(--surface); }
.pm-branch-new { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-top: 14px; padding: 14px; border: 1px dashed var(--line); border-radius: var(--r); }
.pm-branch-new .field { flex: 1; min-width: 200px; gap: 6px; }
.pm-branch-new select, .pm-branch-new input { width: 100%; height: 40px; }
.pm-branch-new .btn { height: 40px; }
.pm-add-modal .field label.pm-label { color: var(--text); font-size: 14px; font-weight: 500; }

/* ---- tile details (New task "Add details" and the task popup's "Tile details") ---- */
.pm-more { margin-top: 14px; border: 1px solid var(--line); border-radius: var(--r); }
.pm-more summary { display: flex; align-items: baseline; gap: 10px; padding: 12px 14px; cursor: pointer; font-size: 14px; font-weight: 600; list-style: none; }
.pm-more summary::-webkit-details-marker { display: none; }
.pm-more summary::before { content: "+"; width: 14px; color: var(--accent); font-weight: 700; }
.pm-more[open] > summary::before { content: "–"; }
.pm-more summary span { color: var(--muted); font-size: 13px; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-notes .pm-more { margin-top: 0; }
.pm-add-modal .pm-compose { max-height: calc(100vh - 48px); overflow-y: auto; }
.panel.pm-modal { max-height: calc(100vh - 32px); }
.pm-notes { max-height: calc(100vh - 32px); overflow-y: auto; }
.pm-chip.cool { border-color: rgba(90, 176, 255, .7); color: var(--sky); }

/* version next to the wordmark */
.os-ver { margin-left: 2px; padding: 2px 6px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 10px; font-weight: 500; letter-spacing: .04em; line-height: 1.3; text-transform: none; }

/* ---- task fields (pm-editor.js): New task "More" and the task popup ---- */
.pm-ed { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.pm-more > .pm-ed { padding: 2px 14px 14px; }
.pm-more .pm-more { margin-top: 2px; }
.pm-ed .field { gap: 6px; min-width: 0; }
.pm-ed .pm-flabel { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.pm-ed .pm-flabel label, .pm-notes .field label { color: var(--muted); font-size: 13px; font-weight: 500; line-height: 16px; }
.pm-ed .pm-flabel .pm-count, .pm-ed-title .pm-count { color: var(--muted); font-size: 12px; }
.pm-ed input:not([type=checkbox]), .pm-place select { width: 100%; min-width: 0; height: 40px; font-size: 14px; }
.pm-ed-title { position: relative; }
.pm-ed-title .pm-title-in { height: 44px; font-size: 16px; font-weight: 600; }
.pm-ed-title .pm-count { position: absolute; right: 12px; top: 14px; }
.pm-ed-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.pm-place { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.pm-ed button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* status, due, flag: dropdowns */
.pm-ed select { width: 100%; min-width: 0; height: 40px; font-size: 14px; }
.pm-dotsel { position: relative; }
.pm-dotsel .dot { position: absolute; left: 14px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; background: var(--sc); pointer-events: none; }
.pm-ed .pm-dotsel select { padding-left: 32px; }
.pm-due, .pm-flagsel { display: flex; flex-direction: column; gap: 6px; }
.pm-ed .pm-flagsel.has select { border-color: rgba(255, 181, 71, .7); color: var(--amber); }
.pm-x { display: inline-grid; place-items: center; width: 32px; height: 32px; flex: none; padding: 0; border: 0; border-radius: var(--r); background: transparent; color: var(--muted); cursor: pointer; }
.pm-x svg { width: 14px; height: 14px; }
.pm-x:hover { color: var(--text); background: rgba(255, 255, 255, .06); }

/* checklist */
.pm-check-rows { display: flex; flex-direction: column; }
.pm-check-row { display: grid; grid-template-columns: 20px minmax(0, 1fr) 32px; align-items: center; gap: 8px; min-height: 38px; border-bottom: 1px solid var(--line); }
.pm-check-row input[type=checkbox] { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.pm-ed .pm-check-row input:not([type=checkbox]) { height: 36px; padding: 0 8px; border-color: transparent; background: transparent; }
.pm-ed .pm-check-row input:not([type=checkbox]):hover, .pm-ed .pm-check-row input:not([type=checkbox]):focus { border-color: var(--line); background: rgba(255, 255, 255, .04); }
.pm-check-row.done input:not([type=checkbox]) { color: var(--muted); text-decoration: line-through; }
.pm-check-add { margin-top: 8px; }

/* top line, number, start → finish */
.pm-pair { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; }
.pm-pair.num { grid-template-columns: 84px minmax(0, 1fr); }
.pm-pair.num .pm-sep { display: none; }
.pm-sep { color: var(--muted); }
.pm-ed .pm-num-in { text-align: center; color: var(--accent); font-size: 18px; font-weight: 700; }

/* chips */
.pm-chiprows, .pm-facts { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.pm-chiprows-list, .pm-facts-list { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.pm-chiprow { display: grid; grid-template-columns: auto minmax(0, 1fr) 32px; align-items: center; gap: 8px; }
.pm-ed select.pm-tone { width: 92px; height: 34px; font-size: 13px; }
.pm-ed select.pm-tone.hot { color: var(--danger); }
.pm-ed select.pm-tone.warn { color: var(--amber); }
.pm-ed select.pm-tone.cool { color: var(--sky); }
.pm-ed .pm-chip-in { height: 34px; border: 1px solid; border-radius: 999px; padding: 0 14px; font-size: 13px; font-weight: 600; }
.pm-ed .pm-chip-in.hot { border-color: transparent; background: var(--danger); color: #2a0a0a; }
.pm-ed .pm-chip-in.hot::placeholder { color: rgba(42, 10, 10, .6); }
.pm-ed .pm-chip-in.warn { border-color: rgba(255, 181, 71, .7); color: var(--amber); background: transparent; }
.pm-ed .pm-chip-in.cool { border-color: rgba(90, 176, 255, .7); color: var(--sky); background: transparent; }
.pm-addrow { height: 34px; }

/* facts */
.pm-fact { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr) 32px; align-items: center; gap: 8px; }
.pm-ed .pm-fact.half input { border-style: dotted; }

@media (max-width: 560px) {
  .pm-ed-row, .pm-place { grid-template-columns: 1fr; }
  .pm-pair.route { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .pm-pair.route .pm-sep { justify-self: center; transform: rotate(90deg); line-height: 1; }
  .pm-ed select.pm-tone { width: 78px; }
  .pm-fact { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 32px; gap: 6px; }
  .pm-more > .pm-ed { padding: 2px 10px 12px; }
}

/* ---- motion: short, transform + opacity only (no blur), off with reduced motion ---- */
@keyframes pop-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
dialog[open] { animation: pop-in .2s cubic-bezier(.2, .8, .2, 1); }
dialog[open]::backdrop { animation: fade-in .2s ease-out; }
.menu:not([hidden]) { animation: pop-in .14s cubic-bezier(.2, .8, .2, 1); transform-origin: top right; }
.page-in { animation: page-in .26s cubic-bezier(.2, .8, .2, 1); }
@media (prefers-reduced-motion: reduce) {
  dialog[open], dialog[open]::backdrop, .menu:not([hidden]), .page-in { animation: none; }
}
.main.pm, .pm-lanes-wrap, .pm-lanes-scroll { min-width: 0; max-width: 100%; } /* the lanes scroll inside; the page never does */

/* ---- scrollbars: thin, emerald ---- */
* { scrollbar-width: thin; scrollbar-color: rgba(52, 211, 153, .4) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { border: 3px solid transparent; border-radius: 999px; background: rgba(52, 211, 153, .4); background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(52, 211, 153, .65); }
::-webkit-scrollbar-corner { background: transparent; }

/* ---- dropdowns: our own field everywhere; our own list where the browser allows it ---- */
select {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  padding-right: 38px; border: 1px solid var(--input); border-radius: var(--r); color: var(--text);
  background: rgba(255, 255, 255, .06) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a7abb4' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 14px;
}
select:hover:not(:disabled) { border-color: rgba(255, 255, 255, .28); }
select:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(52, 211, 153, .18); }
select:disabled { cursor: default; opacity: .6; }
option { background: #1a1c21; color: var(--text); }
@supports (appearance: base-select) {
  select, ::picker(select) { appearance: base-select; }
  select { display: flex; align-items: center; background-image: none; }
  select::picker-icon {
    content: ""; width: 14px; height: 14px; margin-left: auto; background: currentColor; color: var(--muted);
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
    transition: rotate .15s ease;
  }
  select:open::picker-icon { rotate: 180deg; color: var(--accent); }
  select:open { border-color: var(--accent); }
  ::picker(select) {
    margin-top: 6px; padding: 6px; max-height: min(340px, 60vh); overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, .12); border-radius: 12px; background: #1a1c21; color: var(--text);
    box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .7);
  }
  select:open::picker(select) { animation: pop-in .14s cubic-bezier(.2, .8, .2, 1); }
  option { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 12px; border-radius: 8px; background: transparent; font-size: 14px; cursor: pointer; }
  option:hover, option:focus-visible { outline: none; background: rgba(255, 255, 255, .07); }
  option:checked { color: var(--accent); font-weight: 600; }
  option::checkmark { order: 1; margin-left: auto; color: var(--accent); content: "✓"; }
  option:disabled { opacity: .45; }
  @media (prefers-reduced-motion: reduce) { select:open::picker(select) { animation: none; } select::picker-icon { transition: none; } }
}
@media (max-width: 560px), (pointer: coarse) {
  .pm-x { width: 40px; height: 40px; }
  .pm-check-row { grid-template-columns: 22px minmax(0, 1fr) 40px; }
  .pm-chiprow { grid-template-columns: auto minmax(0, 1fr) 40px; }
  .pm-fact { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 40px; }
}
.layout > *, .main, .sidebar { min-width: 0; max-width: 100%; } /* columns shrink to the screen; wide tables scroll inside their own box */

/* ---- phone: the board as a list (section, then its cards by status); dropdown text on one line ---- */
@media (max-width: 700px) {
  .pm-lanes { grid-template-columns: minmax(0, 1fr); min-width: 0; gap: 8px; }
  .pm-lanes > div:first-child, .pm-lanes .pm-lh { display: none; }
  .pm-lanes .pm-area { margin-top: 14px; }
  .pm-lanes .pm-cell:not(:has(.pm-card)) { display: none; }
  .pm-lanes .pm-cell::before { display: block; margin: 2px 4px 8px; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
  .pm-lanes .pm-cell[data-status=next]::before { content: "Up next"; }
  .pm-lanes .pm-cell[data-status=moving]::before { content: "In motion"; }
  .pm-lanes .pm-cell[data-status=waiting]::before { content: "Waiting on others"; }
  .pm-lanes .pm-cell[data-status=done]::before { content: "Done"; }
  .pm-lanes-wrap { padding: 16px; }
  .main-head { flex-wrap: wrap; }
  .main-head .btn { white-space: nowrap; }
}
select { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@supports (appearance: base-select) {
  select { position: relative; }
  select::picker-icon { position: absolute; right: 12px; top: 50%; margin-top: -7px; }
}
@supports (appearance: base-select) {
  /* the arrow is drawn as a background so long text stops before it */
  select { overflow: clip; overflow-clip-margin: content-box; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a7abb4' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 14px; }
  select:open { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2334d399' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 15l6-6 6 6'/%3E%3C/svg%3E"); }
  select::picker-icon { display: none; }
}

/* ---- navigation, as on the client's board: one pill of tabs, the open one filled ---- */
.topbar .tabs { flex: 0 1 auto; gap: 2px; margin-right: auto; padding: 4px; max-width: 100%; overflow-x: auto; scrollbar-width: none; border: 1px solid var(--line); border-radius: 999px; background: #16181d; }
.topbar .tabs::-webkit-scrollbar { display: none; }
.topbar .tab { flex: none; height: 34px; padding: 0 16px; border-radius: 999px; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.topbar .tab:hover { color: var(--text); background: transparent; }
.topbar .tab.active { background: var(--accent); color: var(--on-accent); }
.nav-add { display: grid; place-items: center; width: 40px; height: 40px; flex: none; padding: 0; border: 0; border-radius: 50%; background: var(--accent); color: var(--on-accent); cursor: pointer; }
.nav-add svg { width: 20px; height: 20px; }
.nav-add:hover { background: var(--accent-hover); }
.nav-add[hidden] { display: none; }
@media (max-width: 760px) {
  .topbar .tab { height: 32px; padding: 0 11px; font-size: 11px; letter-spacing: .1em; }
  .nav-add { width: 36px; height: 36px; }
}

/* ---- blur behind popups: one filter on the still page ---- */
#app-screen > * { transition: filter .18s ease-out; } /* each part, so the fixed dock keeps its place */
body.modal-open #app-screen > * { filter: blur(5px) brightness(.85); }
@media (prefers-reduced-motion: reduce) { #app-screen > * { transition: none; } }
@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; height: auto; row-gap: 10px; padding-top: 10px; padding-bottom: 10px; overflow: visible; }
  .topbar .brand { white-space: nowrap; margin-right: auto; }
  .topbar .tabs { order: 10; flex: 1 1 100%; margin-right: 0; }
  .topbar .tabs:not(:has(.tab:not([hidden]))) { display: none; }
}

/* Complete ✓: the step after Done, filed off the board into Completed */
.pm-cyc.complete { border-color: transparent; background: var(--accent); color: var(--on-accent); font-weight: 700; }
.pm-finish.complete, #pm-panel .pm-finish:is(.complete) { border-color: transparent; background: var(--accent); color: var(--on-accent); }
/* the + sits inside the tab pill, at the end */
.topbar .tabs .nav-add { width: 34px; height: 34px; position: sticky; left: 0; }
.topbar .tabs .nav-add svg { width: 18px; height: 18px; }
@media (max-width: 760px) { .topbar .tabs .nav-add { width: 32px; height: 32px; } }

/* New task lives in the tab pill now (#nav-add); the old + in the 40K header is gone */
#pm-new { display: none !important; }
