/* SKM//WEB app components, on the vendored jx tokens. Roles only, no raw hex. */

html, body { margin: 0; background: var(--c-page); color: var(--c-text); }
[hidden] { display: none !important; }
a { color: var(--c-glyph); }
.small { font-size: 12px; }
.inline { display: inline; margin: 0; }
.grow { flex: 1; }
.num { font-variant-numeric: tabular-nums; }
.faint { color: var(--c-text-3); }
.jx-net { color: var(--c-net); }
.jx-select--sm { min-height: 26px; padding-top: 0; padding-bottom: 0; font-size: 12px; }
.trunc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* Shell additions. The rail carries `popover` for the phone drawer; on
   wider screens it sits in the grid, so undo the UA popover styles. */
@media (min-width: 721px) {
  .jx-shell > .jx-rail[popover] {
    position: static; inset: auto; margin: 0; padding: 0; width: auto; height: auto; overflow-y: auto;
    border: 0; border-right: 1px solid var(--c-rule); color: inherit; background: var(--c-sheet); display: flex;
  }
}
.rail-org { border-top: 1px solid var(--c-rule); padding: 0 14px 12px; }
.rail-org .jx-nav-sec { padding-left: 0; padding-right: 0; }
.rail-org .org-name { font: 500 13px var(--font-mono); color: var(--c-text); padding: 4px 0; }
.rail-org .jx-select { width: 100%; }
.rail-org .new-org { font-size: 12px; margin-top: 6px; display: inline-block; }
.topbrand { border: 0; min-height: 0; }
.jx-bar h1 .crumb { color: var(--c-text-2); text-decoration: none; }
.jx-bar h1 .crumb:hover { color: var(--c-text-strong); }
.jx-bar h1 .jx-pill { margin-left: 4px; }
.banner { margin: 12px 18px 0; }
.sec { margin: 20px 0 8px; }
.narrow { max-width: 960px; }

/* Drive */
.drive { padding-bottom: 48px; }
.folders { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.ftile { display: flex; align-items: center; border: 1px solid var(--c-rule); background: var(--c-sheet); }
.ftile:hover { border-color: var(--c-rule-2); }
.ftile .fname { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 0 12px; min-height: 40px; color: var(--c-text); text-decoration: none; font: 13px var(--font-mono); }
.ftile .fname .ico { color: var(--c-net); }
.ftile .fname .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.ftile .fname:hover { color: var(--c-text-strong); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.dcard { border: 1px solid var(--c-rule); background: var(--c-sheet); display: flex; flex-direction: column; min-width: 0; }
.dcard:hover { border-color: var(--c-rule-2); }
.dthumb { display: block; aspect-ratio: 4 / 3; background: var(--c-field); border-bottom: 1px solid var(--c-rule); overflow: hidden; }
.dthumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.nothumb { height: 100%; display: flex; align-items: center; justify-content: center; font: 500 var(--fs-label) var(--font-mono); letter-spacing: var(--tracking-label); color: var(--c-faint); }
.dmeta { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dtitle { gap: 4px; align-items: center; }
.dname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--c-text); text-decoration: none; font: 500 13px var(--font-mono); }
.dname:hover { color: var(--c-text-strong); }
.dsub { font: 11px var(--font-mono); color: var(--c-text-3); font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dsub.faint { color: var(--c-muted); }
.jx-menu .pop { z-index: 20; min-width: 180px; }
.jx-menu .pop button.jx-menu-item { width: 100%; text-align: left; background: none; border: 0; font: inherit; cursor: pointer; }
.drive-foot { margin-top: 32px; max-width: 420px; }
.storage-hd { margin-bottom: 6px; font: 12px var(--font-mono); color: var(--c-text-2); }
.empty-card { margin-top: 8px; }
td.acts { white-space: nowrap; }
td.acts > * + * { margin-left: 6px; }

/* Viewer */
.viewer { flex: 1; min-height: 0; display: flex; background: var(--c-field); }
.viewer .render { flex: 1; border: 0; width: 100%; min-height: 480px; background: var(--c-field); }
.viewer-foot { border-top: 1px solid var(--c-rule); padding: 6px 18px; font: 11px var(--font-mono); color: var(--c-text-3); }
/* Segmented links: the .jx-seg button look on anchors. */
.jx-seg > a.segl {
  display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 12px; text-decoration: none;
  font: 500 var(--fs-label) var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--c-text-3);
}
.jx-seg > a.segl + a.segl { border-left: 1px solid var(--c-rule-2); }
.jx-seg > a.segl:hover { color: var(--c-text); }
.jx-seg > a.segl[aria-pressed="true"] { background: var(--c-sheet-2); color: var(--c-text-strong); box-shadow: inset 0 -2px var(--c-accent); }

/* Editor: bar plus the studio filling the rest. */
body.fullscreen { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.editor-bar { flex: none; padding-left: 0; }
.editor-bar .inline-brand { border-bottom: 0; border-right: 1px solid var(--c-rule); min-height: 36px; }
.editor-bar h1 { font-size: 13px; min-width: 0; }
.save-state { font: 11px var(--font-mono); color: var(--c-text-3); font-variant-numeric: tabular-nums; }
body.fullscreen skm-studio { flex: 1; min-height: 0; border: 0; }
skm-studio:not(:defined) { visibility: hidden; }
html.paper body.fullscreen { background: #ffffff; }
skm-studio .file { font-size: 12px; color: var(--c-text-2); white-space: nowrap; }
skm-studio .file .dirty { color: var(--c-accent); }
skm-studio .notice { font-size: 12px; color: var(--c-warn); white-space: nowrap; }
skm-studio .notice.err { color: var(--c-err); }
skm-studio .notice button {
  min-height: 24px; padding: 0 8px; margin-left: 6px; background: transparent; border: 1px solid var(--c-rule-2); border-radius: 0;
  font: 500 11px var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--c-text-2); cursor: pointer;
}
skm-studio .notice button:hover { color: var(--c-text-strong); border-color: var(--c-accent); }

/* Sign-in and other bare pages */
body.bare { min-height: 100vh; }
.auth-wrap { max-width: 420px; margin: 0 auto; padding: 64px 16px; }
.auth-brand { border: 0; padding: 0 0 16px; font-size: 15px; }
.auth-card { padding-top: 24px; }
.auth-card form { margin-top: 8px; }
.auth-alt { font: 12px var(--font-mono); color: var(--c-text-3); margin: 16px 0 0; }
.dev-creds { margin-top: 20px; }
.dev-creds .jx-label { margin-bottom: 6px; }
.error-page { max-width: 560px; margin: 0 auto; padding: 64px 16px; }

/* Billing */
.pillval { font-size: 15px; padding-top: 6px; }
.small-val { font-size: 15px; padding-top: 6px; }
.plan { display: flex; gap: 32px; flex-wrap: wrap; align-items: flex-start; margin: 8px 0 16px; }
.plan .amt { font: 500 var(--fs-readout) var(--font-mono); color: var(--c-glyph); }
.plan .per { font: 12px var(--font-mono); color: var(--c-text-3); }
.plan .jx-list { flex: 1; min-width: 260px; }
.seats .jx-input { width: 96px; }
.dev .jx-row { flex-wrap: wrap; gap: 8px; }

/* Mock payment provider: plainly not the real one. */
.mock-stripe { min-height: 100vh; }
.mock-banner { background: var(--c-grove-deep); border-bottom: 1px solid var(--c-grove-rule); color: var(--c-warn); text-align: center; padding: 8px; font: 500 var(--fs-label) var(--font-mono); letter-spacing: var(--tracking-label); }
.checkout { display: grid; grid-template-columns: 1fr 1fr; min-height: calc(100vh - 34px); }
.checkout .order { padding: 48px; border-right: 1px solid var(--c-rule); background: var(--c-sheet); }
.checkout .pay { padding: 48px; max-width: 420px; display: flex; flex-direction: column; gap: 12px; }
.checkout .back, .portal .back { color: var(--c-text-3); text-decoration: none; font: 12px var(--font-mono); display: inline-block; margin-bottom: 32px; }
.checkout .product { font: 500 15px var(--font-mono); letter-spacing: var(--tracking-wordmark); margin: 8px 0 4px; }
.checkout .product .sep { color: var(--c-accent); }
.checkout .big { font: 500 36px var(--font-mono); margin: 8px 0 24px; font-variant-numeric: tabular-nums; }
.checkout .big .per { font-size: 13px; color: var(--c-text-3); }
.saved-card { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--c-glyph); background: var(--c-sheet); font: 13px var(--font-mono); }
.saved-card span { white-space: nowrap; }
.dev form.inline { display: inline-flex; gap: 6px; align-items: center; }
.brandmark { font: 700 12px var(--font-mono); letter-spacing: .1em; color: var(--c-dim); border: 1px solid var(--c-rule-2); padding: 2px 6px; }
.paybtn { width: 100%; }
.portal { max-width: 620px; margin: 0 auto; padding: 32px 16px; }

@media (max-width: 720px) {
  .checkout { grid-template-columns: 1fr; }
  .checkout .order, .checkout .pay { padding: 24px 16px; border-right: 0; }
  .cards { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}
