/* Client portal, app shell */
body.portal {
  --bg: #F5F3EE;
  --panel: #FFFFFF;
  --ink: #18241A;
  --ink-2: #566153;
  --ink-3: #8B9288;
  --line: rgba(24, 36, 26, 0.08);
  --line-strong: rgba(24, 36, 26, 0.14);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
}

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--green); }
.login-card { width: min(360px, 100%); background: var(--panel); border-radius: var(--r-panel); padding: 32px; display: grid; gap: 20px; box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25); animation: rise var(--enter) var(--ease); }
.login-card img { border-radius: 10px; }
.login-card h1 { margin: 0 0 4px; font-family: var(--display); font-weight: 400; font-size: 28px; line-height: 1.1; }
.login-card p { margin: 0; color: var(--ink-2); }
.login-card .btn { width: 100%; }
.login-error { color: var(--fix) !important; font-size: 13px; }

/* Shell */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; padding: 16px 12px; background: var(--green); color: var(--on-green); overflow-y: auto; }
.side-brand { padding: 4px 8px 16px; }
.side-brand img { display: block; height: 30px; width: auto; }
.side-client { display: flex; align-items: center; gap: 10px; padding: 10px; margin-bottom: 12px; border-radius: 10px; background: rgba(255, 243, 230, 0.06); box-shadow: inset 0 0 0 1px var(--line-green); }
.side-mark { flex: none; width: 32px; height: 32px; border-radius: 8px; background: var(--yellow); color: var(--deep); display: grid; place-items: center; font-weight: 600; font-size: 13px; }
.side-client strong { display: block; font-size: 13px; font-weight: 600; line-height: 1.3; }
.side-client small { display: block; font-size: 12px; color: var(--on-green-3); }
.side-nav { display: grid; gap: 2px; }
.side-row {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 34px; padding: 0 10px; border: 0; border-radius: var(--r-control);
  background: transparent; color: var(--on-green-2); font-size: 13px; font-weight: 500; text-decoration: none; text-align: left;
  transition: background-color var(--fast) var(--ease), color var(--fast) var(--ease);
}
.side-row:hover { background: rgba(255, 243, 230, 0.05); color: var(--on-green); }
.side-row span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-row .count { flex: none; font-family: var(--mono); font-size: 11px; color: var(--on-green-3); }
.side-row .count.attn { color: var(--deep); background: var(--yellow); padding: 1px 6px; border-radius: 4px; font-family: var(--font); font-weight: 600; }
.side-row.is-active { background: var(--green-raised); color: var(--on-green); box-shadow: inset 0 0 0 1px var(--line-green); }
.side-row .ext { width: 14px; height: 14px; opacity: 0.5; }
.side-row:focus-visible { outline: 2px solid var(--yellow); outline-offset: -2px; }
.side-label { margin: 20px 0 6px; padding: 0 10px; font-size: 11px; font-weight: 500; color: var(--on-green-3); }
.side-foot { margin-top: auto; display: grid; gap: 8px; padding-top: 16px; }
.side-support { padding: 12px; border-radius: 10px; background: rgba(255, 243, 230, 0.06); font-size: 12px; line-height: 1.5; color: var(--on-green-2); }
.side-support strong { display: block; color: var(--on-green); font-weight: 600; font-size: 13px; margin-bottom: 2px; }
.scrim { display: none; }

/* Top bar */
.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 32px; background: rgba(245, 243, 238, 0.88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-menu { display: none; border: 0; background: transparent; width: 36px; height: 36px; border-radius: var(--r-control); color: var(--ink); place-items: center; margin-left: -8px; }
.top-crumb { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 13px; color: var(--ink-3); }
.top-crumb .icon { width: 14px; height: 14px; }
.top-crumb strong { color: var(--ink); font-weight: 600; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.live-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 14px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); font-size: 12px; font-weight: 500; color: var(--ink-2); }
.live-chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #4F9A45; }

/* Content */
.content { padding: 32px 32px 64px; max-width: 1280px; width: 100%; animation: fadein var(--enter) var(--ease); }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-head h1 { margin: 0 0 4px; font-family: var(--display); font-weight: 400; font-size: 32px; line-height: 1.1; }
.page-head p { margin: 0; color: var(--ink-2); }

.grid { display: grid; gap: 16px; }
.g-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 16px; }
.g-main { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); align-items: start; margin-bottom: 16px; }

.panel { background: var(--panel); border-radius: var(--r-card); box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgba(24, 36, 26, 0.04); overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 52px; padding: 0 20px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0; font-size: 14px; font-weight: 600; }
.panel-head a, .panel-head button.link { border: 0; background: none; padding: 0; font-size: 13px; font-weight: 500; color: var(--ink-2); text-decoration: none; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.panel-head a:hover, .panel-head button.link:hover { color: var(--ink); }
.panel-head .icon { width: 14px; height: 14px; }

/* Stat tiles */
.stat { padding: 16px 20px 18px; display: grid; gap: 4px; }
.stat-label { font-size: 12px; font-weight: 500; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.stat-label .icon { width: 14px; height: 14px; }
.stat-value { font-size: 24px; font-weight: 600; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; line-height: 1.25; }
.stat-sub { font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat.attn { box-shadow: 0 0 0 1px var(--line), inset 0 3px 0 var(--yellow); }

/* Live site card */
.site { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
.site-shot { display: block; margin: 16px 0 0 16px; border-radius: 8px 0 0 0; overflow: hidden; background: #F0ECE5; box-shadow: 0 0 0 1px var(--line); align-self: end; }
.site-shot .bar { display: flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px; background: #F3EFE8; border-bottom: 1px solid var(--line); }
.site-shot .bar i { width: 7px; height: 7px; border-radius: 50%; background: rgba(24, 36, 26, 0.16); }
.site-shot img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; }
.site-links { list-style: none; margin: 0; padding: 8px 12px; display: grid; align-content: center; }
.site-links a { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-radius: var(--r-control); text-decoration: none; transition: background-color var(--fast) var(--ease); }
.site-links a:hover { background: rgba(24, 36, 26, 0.04); }
.site-links .ico { flex: none; width: 32px; height: 32px; border-radius: 8px; background: var(--bg); display: grid; place-items: center; color: var(--ink-2); }
.site-links .lt { flex: 1; min-width: 0; }
.site-links strong { display: block; font-size: 13px; font-weight: 600; }
.site-links small { display: block; font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.site-links .ext { color: var(--ink-3); width: 14px; height: 14px; }

/* Timeline */
.tl { list-style: none; margin: 0; padding: 4px 20px 8px; }
.tl li { display: grid; grid-template-columns: 56px 1fr; gap: 12px; padding: 14px 0; }
.tl li + li { border-top: 1px solid var(--line); }
.tl .d { font-size: 12px; font-weight: 600; color: var(--ink-2); line-height: 1.35; font-variant-numeric: tabular-nums; }
.tl .d small { display: block; font-weight: 500; color: var(--ink-3); }
.tl strong { display: block; font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.tl span { font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.tl li.soon .d { color: var(--ink); }
.tl li.soon .d::after { content: ""; display: block; width: 20px; height: 3px; margin-top: 6px; border-radius: 2px; background: var(--yellow); }

/* Tables */
.table { width: 100%; border-collapse: collapse; }
.table th { height: 36px; padding: 0 16px; text-align: left; font-size: 12px; font-weight: 500; color: var(--ink-3); border-bottom: 1px solid var(--line); background: #FBFAF7; white-space: nowrap; }
.table td { height: 60px; padding: 0 16px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table th:first-child, .table td:first-child { padding-left: 20px; }
.table th:last-child, .table td:last-child { padding-right: 12px; text-align: right; }
.table tbody tr { cursor: pointer; transition: background-color var(--fast) var(--ease); }
.table tbody tr:hover { background: #FBFAF7; }
.table .name { display: flex; align-items: center; gap: 12px; color: var(--ink); font-weight: 600; white-space: normal; }
.table .thumb { flex: none; width: 56px; height: 36px; border-radius: 4px; overflow: hidden; background: #F0ECE5; box-shadow: 0 0 0 1px var(--line); }
.table .thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.table .ficon { flex: none; width: 36px; height: 36px; border-radius: 8px; background: var(--bg); display: grid; place-items: center; color: var(--ink-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; }
.table th.num { font-weight: 500; color: var(--ink-3); }
.table .mono { font-family: var(--mono); font-size: 12px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: var(--r-control); color: var(--ink-3); text-decoration: none; transition: background-color var(--fast) var(--ease), color var(--fast) var(--ease); }
.icon-btn:hover { background: rgba(24, 36, 26, 0.06); color: var(--ink); }
.tag.ok { background: #E7F0E3; color: #3A6B33; }

/* Feedback boards */
.boards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.board { display: grid; text-decoration: none; color: inherit; transition: box-shadow var(--fast) var(--ease); }
.board:hover { box-shadow: 0 0 0 1px var(--line-strong), 0 8px 24px -12px rgba(24, 36, 26, 0.2); }
.board-thumb { aspect-ratio: 16 / 9; background: #F0ECE5; overflow: hidden; border-bottom: 1px solid var(--line); }
.board-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.board-body { padding: 16px 20px; display: grid; gap: 4px; }
.board-body strong { font-size: 14px; font-weight: 600; }
.board-body p { margin: 0; font-size: 13px; color: var(--ink-2); }
.board-foot { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.board-foot .go { display: inline-flex; align-items: center; gap: 4px; color: var(--ink); font-weight: 600; font-size: 13px; }
.board-foot .go .icon { width: 14px; height: 14px; }
.how { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.how .panel { padding: 16px 20px; display: grid; grid-template-columns: 28px 1fr; gap: 2px 12px; align-content: start; }
.how .tab-num { grid-row: span 2; }
.how strong { font-size: 13px; font-weight: 600; }
.how span { font-size: 13px; color: var(--ink-2); }

/* Project */
.checks { list-style: none; margin: 0; padding: 4px 20px 8px; display: grid; grid-template-columns: 1fr 1fr; column-gap: 32px; }
.checks li { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.checks li .state { margin-left: auto; font-size: 12px; color: var(--ink-3); }
.checks .ok { flex: none; width: 20px; height: 20px; border-radius: 50%; background: #E7F0E3; color: #3A6B33; display: grid; place-items: center; }
.checks .ok .icon { width: 12px; height: 12px; stroke-width: 2; }
.checks .wait { flex: none; width: 20px; height: 20px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.facts { margin: 0; padding: 4px 20px 8px; display: grid; grid-template-columns: auto 1fr; gap: 0 16px; }
.facts dt, .facts dd { padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.facts dt { color: var(--ink-3); }
.facts dd { margin: 0; text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; }
.facts dd.mono { font-family: var(--mono); font-size: 12px; }
.facts dt:last-of-type, .facts dd:last-of-type { border-bottom: 0; }
.support-body { padding: 16px 20px 20px; font-size: 13px; color: var(--ink-2); line-height: 1.6; }
.support-body p { margin: 0 0 8px; }
.support-body p:last-child { margin: 0; }
.support-body strong { color: var(--ink); font-weight: 600; }
.empty { padding: 32px 20px; text-align: center; color: var(--ink-3); font-size: 13px; }

/* Responsive */
@media (max-width: 1180px) {
  .g-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 272px; z-index: 30; transform: translateX(-100%); transition: transform var(--enter) var(--ease); }
  .shell.nav-open .side { transform: none; }
  .shell.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 20; background: rgba(18, 32, 16, 0.4); }
  .top { padding: 0 16px; }
  .top-menu { display: grid; }
  .top-crumb #crumb-client, .top-crumb .icon { display: none; }
  .live-chip { display: none; }
  .content { padding: 20px 16px 48px; }
  .page-head h1 { font-size: 26px; }
  .site { grid-template-columns: 1fr; }
  .site-shot { margin: 16px 16px 0; border-radius: 8px 8px 0 0; }
  .how { grid-template-columns: 1fr; }
  .checks { grid-template-columns: 1fr; }
  .col-hide { display: none; }
  .table td { height: 56px; }
}
@media (max-width: 520px) {
  .g-stats { gap: 12px; }
  .stat { padding: 14px 16px; }
  .stat-value { font-size: 20px; }
  .top-cta-long { display: none; }
}

.tag.sm { height: 20px; padding: 0 6px; font-size: 11px; vertical-align: 1px; }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 520px) { .g-3 { grid-template-columns: 1fr; } }
.site-links li { min-width: 0; }
.side-mark { font-size: 11px; letter-spacing: -0.02em; }
.g-main > .panel:first-child { align-self: stretch; display: flex; flex-direction: column; }
.g-main > .panel:first-child > .site, .g-main > .panel:first-child > .table { flex: 1; }
.site-shot { align-self: stretch; display: flex; flex-direction: column; margin-top: 20px; }
.site-shot img { flex: 1; min-height: 0; height: 100%; aspect-ratio: auto; }
@media (max-width: 900px) { .site-shot img { aspect-ratio: 16 / 10; height: auto; } }

/* Client logos */
.side-client.has-logo { flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px 12px 12px; }
.side-client.has-logo #side-logo { display: block; max-width: 100%; max-height: 52px; width: auto; }
.side-client.has-logo .side-mark, .side-client.has-logo #side-client { display: none; }
.side-client.has-logo small { font-size: 12px; }
.login-logo { padding-bottom: 4px; }
.login-logo img { display: block; max-height: 72px; max-width: 220px; }
.login-logo:not([hidden]) ~ .login-flower { display: none; }

.login-switch { justify-self: start; border: 0; background: none; padding: 0; font-size: 13px; color: var(--ink-2); text-decoration: underline; cursor: pointer; }
.login-switch:hover { color: var(--ink); }
