:root {
  --bg: #0d1014;
  --surface: #151a20;
  --surface-2: #1b2129;
  --surface-3: #222a34;
  --line: #2b3541;
  --line-soft: #202832;
  --text: #f4f7fb;
  --muted: #93a0ae;
  --accent: #ff8a2a;
  --accent-2: #ffb15f;
  --green: #48d597;
  --red: #ff6b6b;
  --shadow: 0 20px 55px rgba(0,0,0,.28);
  --radius: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body { min-height: 100vh; }
button, input, select { font: inherit; }
button { color: inherit; }
.hidden { display: none !important; }

.app-shell { display: grid; grid-template-columns: 246px minmax(0,1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 22px 16px; background: #101419; border-right: 1px solid var(--line-soft); display: flex; flex-direction: column; z-index: 30; }
.brand-row { display: flex; align-items: center; gap: 12px; padding: 4px 7px 23px; border-bottom: 1px solid var(--line-soft); }
.brand-row strong { display: block; font-size: 17px; letter-spacing: .01em; }
.brand-row span { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; text-transform: uppercase; letter-spacing: .08em; }
.brand-mark { width: 62px; height: 62px; border-radius: 18px; display: grid; place-items: center; background: linear-gradient(145deg, #ff9d3d, #ef6b08); color: #17110b; font-weight: 900; font-size: 18px; letter-spacing: -.03em; box-shadow: 0 12px 32px rgba(255,138,42,.24); }
.brand-mark.small { width: 42px; height: 42px; border-radius: 12px; font-size: 12px; }
.side-nav { display: grid; gap: 8px; padding-top: 20px; }
.nav-button { border: 1px solid transparent; background: transparent; display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 13px; border-radius: 12px; cursor: pointer; color: #aab5c1; font-weight: 650; text-align: left; transition: .2s ease; }
.nav-button:hover { background: #171c23; color: #fff; }
.nav-button.active { color: #fff; background: linear-gradient(90deg, rgba(255,138,42,.15), rgba(255,138,42,.05)); border-color: rgba(255,138,42,.25); }
.nav-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: #20262f; color: var(--accent-2); }
.nav-button.active .nav-icon { background: var(--accent); color: #16100a; }
.sidebar-foot { margin-top: auto; display: grid; gap: 12px; }
.privacy-pill { color: #7f8b98; font-size: 11px; display: flex; align-items: center; gap: 7px; padding: 0 5px; }
.status-dot, .file-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(72,213,151,.08); flex: 0 0 auto; }
.logout-button { width: 100%; }

.main-content { min-width: 0; padding: 28px 32px 42px; }
.topbar { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.topbar h1 { margin: 2px 0 0; font-size: clamp(27px, 3vw, 38px); letter-spacing: -.04em; }
.eyebrow { font-size: 10px; letter-spacing: .16em; color: var(--accent-2); font-weight: 850; text-transform: uppercase; }
.quality-badge { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 9px 12px; min-width: 190px; }
.quality-badge span { display: block; color: var(--muted); font-size: 9px; letter-spacing: .13em; }
.quality-badge strong { display: block; font-size: 12px; margin-top: 3px; }
.tool-panel { display: none; }
.tool-panel.active { display: block; }
.intro-grid { display: flex; justify-content: space-between; align-items: end; gap: 30px; padding: 6px 2px 22px; }
.intro-grid h2 { margin: 0 0 8px; font-size: clamp(20px, 2.2vw, 29px); letter-spacing: -.025em; }
.intro-grid p { margin: 0; max-width: 760px; color: var(--muted); line-height: 1.58; font-size: 14px; }
.feature-strip { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.feature-strip span { border: 1px solid var(--line); background: #12171d; color: #9ca9b6; font-size: 10px; padding: 6px 8px; border-radius: 999px; }

.upload-card { position: relative; min-height: 142px; border: 1px dashed #3a4654; border-radius: var(--radius); background: radial-gradient(circle at 10% 10%, rgba(255,138,42,.07), transparent 30%), var(--surface); display: flex; align-items: center; gap: 17px; padding: 26px; cursor: pointer; transition: .2s ease; }
.upload-card:hover, .upload-card.dragging { border-color: var(--accent); background-color: #181e25; transform: translateY(-1px); }
.upload-card > div:nth-of-type(2) { flex: 1; }
.upload-card strong { display: block; font-size: 17px; }
.upload-card span { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; }
.upload-icon { width: 60px; height: 72px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid #35404c; border-radius: 10px 10px 14px 14px; color: var(--accent-2); background: #202731; font-size: 12px; font-weight: 900; letter-spacing: .06em; }
.file-input { position: absolute; inset: 0; opacity: 0; pointer-events: none; }

.btn { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; background: #1a2028; cursor: pointer; transition: .18s ease; font-weight: 750; font-size: 12px; }
.btn:hover { transform: translateY(-1px); border-color: #455362; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { background: #f4f7fb; color: #11161c; border-color: #fff; }
.btn-primary:hover { background: #fff; }
.btn-secondary { background: #202731; }
.btn-accent { background: linear-gradient(135deg, #ff982f, #ff7e18); color: #1b1007; border-color: #ff9b3d; box-shadow: 0 8px 24px rgba(255,126,24,.17); }
.btn-ghost { background: transparent; }
.btn-small { padding: 7px 10px; font-size: 11px; border-radius: 8px; }
.btn-large { padding: 12px 16px; font-size: 13px; }
.full-width { width: 100%; }

.workspace { margin-top: 18px; }
.workspace-toolbar { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border: 1px solid var(--line); background: #11161c; border-radius: 12px; padding: 9px 11px; margin-bottom: 14px; }
.file-chip { min-width: 0; display: flex; align-items: center; gap: 9px; padding: 3px 5px; }
.file-chip > span:not(.file-dot) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 420px; font-size: 12px; font-weight: 750; }
.file-chip small { color: var(--muted); white-space: nowrap; }
.toolbar-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.split-layout { display: grid; grid-template-columns: minmax(0,1fr) 340px; gap: 14px; align-items: start; }
.panel-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.panel-heading { min-height: 67px; padding: 16px 18px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.panel-heading.compact { min-height: 58px; padding: 13px 15px; }
.panel-heading h3 { margin: 2px 0 0; font-size: 15px; }
.selection-count { font-size: 11px; color: var(--muted); }
.page-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 11px; padding: 14px; max-height: 65vh; overflow: auto; }
.page-tile { position: relative; border: 1px solid #303946; border-radius: 11px; overflow: hidden; background: #0f1318; cursor: pointer; transition: .18s ease; user-select: none; }
.page-tile:hover { border-color: #596878; transform: translateY(-1px); }
.page-tile.selected { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(255,138,42,.12); }
.page-tile img { width: 100%; aspect-ratio: .72; object-fit: contain; display: block; background: #e9e9e7; }
.page-tile .page-meta { height: 34px; display: flex; align-items: center; justify-content: space-between; padding: 0 9px; font-size: 10px; }
.page-check { width: 16px; height: 16px; border-radius: 5px; border: 1px solid #586574; display: grid; place-items: center; background: #171d24; }
.page-tile.selected .page-check { background: var(--accent); color: #16100b; border-color: var(--accent); }
.split-builder-card { position: sticky; top: 20px; padding-bottom: 14px; }
.split-builder-card > .field, .split-builder-card > .btn, .split-builder-card > .group-list, .split-builder-card > .result-box { margin-left: 14px; margin-right: 14px; }
.field { display: grid; gap: 7px; margin-top: 13px; }
.field > span, .scope-box legend { color: #a7b2bd; font-size: 10px; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; }
.field input, .field select, .scope-box input[type="text"], .zoom-control select, .crop-settings-card select { width: 100%; border: 1px solid #33404d; background: #10151b; color: #e9edf2; padding: 10px 11px; border-radius: 9px; outline: none; }
.field input:focus, .field select:focus, .scope-box input[type="text"]:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,138,42,.08); }
.field-inline { display: grid; grid-template-columns: 1fr auto; gap: 7px; }
.group-list { display: grid; gap: 8px; margin-top: 14px; }
.group-item { border: 1px solid var(--line); border-radius: 10px; padding: 10px; background: #11161c; }
.group-item-top { display: flex; align-items: center; gap: 8px; }
.group-index { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; background: #2a2118; color: var(--accent-2); font-size: 10px; font-weight: 900; }
.group-item input { min-width: 0; flex: 1; border: none; border-bottom: 1px solid #303a46; background: transparent; color: #fff; padding: 5px 2px; outline: none; font-size: 11px; }
.group-item button { border: none; background: transparent; color: #8c98a5; cursor: pointer; font-size: 16px; }
.group-pages { color: #7f8b98; margin-top: 7px; font-size: 10px; line-height: 1.45; }
.result-box { margin-top: 12px; border: 1px solid rgba(72,213,151,.22); background: rgba(72,213,151,.06); border-radius: 10px; padding: 10px; display: grid; gap: 7px; }
.result-box strong { font-size: 11px; }
.result-link { display: flex; justify-content: space-between; align-items: center; gap: 8px; text-decoration: none; color: #e8fff5; border: 1px solid rgba(72,213,151,.18); padding: 8px 9px; border-radius: 8px; font-size: 10px; background: rgba(0,0,0,.12); }
.result-link:hover { border-color: rgba(72,213,151,.4); }

.crop-layout { display: grid; grid-template-columns: 160px minmax(420px,1fr) 310px; gap: 14px; align-items: start; }
.crop-pages-panel, .crop-settings-card { position: sticky; top: 18px; }
.crop-page-list { padding: 10px; display: grid; gap: 9px; max-height: 76vh; overflow: auto; }
.crop-page-thumb { border: 1px solid #303a45; border-radius: 9px; background: #10151a; overflow: hidden; cursor: pointer; transition: .17s ease; }
.crop-page-thumb.active { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(255,138,42,.1); }
.crop-page-thumb img { width: 100%; aspect-ratio: .72; object-fit: contain; background: #e8e8e5; display: block; }
.crop-page-thumb span { display: block; padding: 6px 8px; font-size: 10px; text-align: center; }
.crop-canvas-card { overflow: hidden; }
.crop-tools-row { min-height: 58px; padding: 10px 12px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.segmented { border: 1px solid #313b47; background: #0f1419; border-radius: 9px; padding: 3px; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); }
.segmented.three { grid-template-columns: repeat(3, minmax(0,1fr)); }
.segmented button { border: 0; background: transparent; color: #8995a2; border-radius: 6px; padding: 7px 9px; cursor: pointer; font-size: 10px; font-weight: 750; white-space: nowrap; }
.segmented button.active { background: #2b2118; color: var(--accent-2); box-shadow: inset 0 0 0 1px rgba(255,138,42,.17); }
.zoom-control { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; }
.zoom-control select { width: auto; padding: 7px 8px; }
.crop-helper { padding: 8px 12px; border-bottom: 1px solid var(--line-soft); background: #121820; color: #8e9ba8; font-size: 10px; }
.preview-scroll { position: relative; overflow: auto; min-height: 520px; max-height: 74vh; padding: 18px; background-color: #0b0e12; background-image: linear-gradient(45deg,#11161c 25%,transparent 25%),linear-gradient(-45deg,#11161c 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#11161c 75%),linear-gradient(-45deg,transparent 75%,#11161c 75%); background-size: 24px 24px; background-position: 0 0,0 12px,12px -12px,-12px 0; }
.preview-stage { position: relative; width: 100%; margin: 0 auto; box-shadow: 0 18px 55px rgba(0,0,0,.48); background: white; transform-origin: top left; }
.preview-stage img { display: block; width: 100%; height: 100%; object-fit: fill; user-select: none; pointer-events: none; }
.preview-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.crop-edit-actions { display: flex; gap: 7px; flex-wrap: wrap; padding: 10px 12px; border-top: 1px solid var(--line-soft); }
.crop-settings-card { padding-bottom: 14px; }
.crop-settings-card > .field, .crop-settings-card > .settings-note, .crop-settings-card > .scope-box, .crop-settings-card > .btn, .crop-settings-card > .result-box { margin-left: 14px; margin-right: 14px; }
.range-row { display: grid; grid-template-columns: 1fr 58px; align-items: center; gap: 8px; }
.range-row input { padding: 0; accent-color: var(--accent); }
.range-row output { font-size: 10px; color: var(--accent-2); text-align: right; }
.settings-note { margin-top: 12px; border: 1px solid #2c3742; border-radius: 10px; background: #11161c; padding: 10px; }
.settings-note strong { display: block; font-size: 11px; }
.settings-note span { display: block; color: var(--muted); font-size: 10px; line-height: 1.45; margin-top: 4px; }
.white-note { background: #f6f6f4; color: #171a1d; }
.white-note span { color: #5d6267; }
.scope-box { border: 1px solid #2d3843; border-radius: 10px; padding: 10px; margin-top: 13px; display: grid; gap: 8px; }
.scope-box legend { padding: 0 5px; }
.scope-box label { font-size: 11px; color: #b8c1ca; display: flex; align-items: center; gap: 7px; }
.scope-box input[type="radio"] { accent-color: var(--accent); }
.scope-box input[type="text"] { margin-top: 4px; font-size: 11px; }

.toast-stack { position: fixed; right: 18px; bottom: 18px; z-index: 1000; display: grid; gap: 8px; width: min(360px, calc(100vw - 36px)); }
.toast { border: 1px solid var(--line); background: #171d24; color: #edf2f7; border-radius: 11px; padding: 11px 13px; box-shadow: var(--shadow); font-size: 11px; animation: toastIn .2s ease; }
.toast.success { border-color: rgba(72,213,151,.3); }
.toast.error { border-color: rgba(255,107,107,.36); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.busy-overlay { position: fixed; inset: 0; z-index: 2000; display: grid; place-content: center; justify-items: center; gap: 13px; background: rgba(7,9,12,.78); backdrop-filter: blur(8px); }
.busy-overlay strong { font-size: 12px; }
.spinner { width: 38px; height: 38px; border: 3px solid #2b333d; border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.login-body { background: radial-gradient(circle at 20% 10%, rgba(255,138,42,.12), transparent 25%), radial-gradient(circle at 90% 85%, rgba(85,106,126,.10), transparent 27%), #0d1014; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(440px, 100%); border: 1px solid var(--line); border-radius: 22px; background: rgba(20,25,31,.94); padding: 30px; box-shadow: 0 30px 90px rgba(0,0,0,.42); }
.login-card .brand-mark { margin-bottom: 22px; }
.login-heading h1 { margin: 3px 0 7px; font-size: 35px; letter-spacing: -.04em; }
.login-heading p { color: var(--muted); margin: 0 0 20px; font-size: 12px; line-height: 1.55; }
.login-form { display: grid; gap: 13px; }
.login-form label { display: grid; gap: 7px; }
.login-form label span { color: #aab4be; font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.login-form input { border: 1px solid #34404c; background: #0f1419; color: #fff; border-radius: 10px; padding: 12px; outline: none; }
.login-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,138,42,.08); }
.alert { border-radius: 10px; padding: 10px 12px; font-size: 11px; margin-bottom: 14px; }
.alert-error { background: rgba(255,107,107,.08); border: 1px solid rgba(255,107,107,.24); color: #ffb0b0; }
.login-note { color: #697582; font-size: 9px; line-height: 1.5; margin: 16px 0 0; }

@media (max-width: 1180px) {
  .crop-layout { grid-template-columns: 130px minmax(360px,1fr); }
  .crop-settings-card { grid-column: 1 / -1; position: static; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 12px; padding: 0 0 14px; }
  .crop-settings-card .panel-heading { grid-column: 1 / -1; }
  .crop-settings-card > .btn, .crop-settings-card > .result-box { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: sticky; height: auto; top: 0; padding: 10px 12px; flex-direction: row; align-items: center; gap: 10px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand-row { border: 0; padding: 0; min-width: 155px; }
  .brand-row span { display: none; }
  .side-nav { padding: 0; display: flex; flex: 1; }
  .nav-button { width: auto; }
  .sidebar-foot { margin: 0 0 0 auto; display: flex; align-items: center; }
  .privacy-pill { display: none; }
  .logout-button { width: auto; }
  .main-content { padding: 20px 16px 34px; }
  .split-layout { grid-template-columns: 1fr; }
  .split-builder-card { position: static; }
  .crop-layout { grid-template-columns: 1fr; }
  .crop-pages-panel { position: static; }
  .crop-page-list { display: flex; max-height: none; overflow-x: auto; }
  .crop-page-thumb { min-width: 90px; width: 90px; }
  .crop-settings-card { grid-column: auto; display: block; }
  .crop-settings-card > .btn, .crop-settings-card > .result-box { grid-column: auto; }
  .preview-scroll { min-height: 400px; }
}
@media (max-width: 640px) {
  .sidebar { flex-wrap: wrap; }
  .brand-row { min-width: auto; }
  .brand-row > div:last-child { display: none; }
  .side-nav { order: 3; width: 100%; }
  .nav-button { flex: 1; justify-content: center; }
  .topbar { align-items: flex-start; }
  .quality-badge { display: none; }
  .intro-grid { display: block; }
  .feature-strip { justify-content: flex-start; margin-top: 14px; }
  .upload-card { flex-wrap: wrap; padding: 18px; }
  .upload-card .btn { width: 100%; }
  .workspace-toolbar { align-items: flex-start; flex-direction: column; }
  .page-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .crop-tools-row { align-items: stretch; flex-direction: column; }
  .segmented { width: 100%; }
  .zoom-control { justify-content: space-between; }
  .preview-scroll { min-height: 330px; padding: 10px; }
}


/* PDF Draw / Vector Markup */
.markup-layout { display: grid; grid-template-columns: 160px minmax(460px,1fr) 300px; gap: 14px; align-items: start; }
.markup-pages-panel, .markup-settings-card { position: sticky; top: 18px; }
.markup-canvas-card { overflow: hidden; }
.markup-tools-row { min-height: 60px; padding: 10px 12px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.zoom-buttons { display: flex; align-items: center; gap: 6px; border-right: 1px solid var(--line-soft); padding-right: 10px; }
.zoom-buttons strong { min-width: 48px; text-align: center; color: var(--accent-2); font-size: 10px; }
.markup-control { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; }
.markup-control input[type="color"] { width: 34px; height: 30px; border: 1px solid #34404c; border-radius: 7px; background: #0f1419; padding: 2px; cursor: pointer; }
.markup-control select { width: auto; min-width: 76px; padding: 7px 8px; }
.markup-stage { min-width: 50%; max-width: 400%; }
#markupCanvas { cursor: crosshair; }
.markup-settings-card { padding-bottom: 14px; }
.markup-settings-card > .field, .markup-settings-card > .settings-note, .markup-settings-card > .btn, .markup-settings-card > .result-box { margin-left: 14px; margin-right: 14px; }
.markup-settings-card > .btn + .btn { margin-top: 9px; }
.print-frame { position: fixed; width: 1px; height: 1px; left: -10000px; top: -10000px; border: 0; opacity: 0; pointer-events: none; }

@media (max-width: 1180px) {
  .markup-layout { grid-template-columns: 130px minmax(360px,1fr); }
  .markup-settings-card { grid-column: 1 / -1; position: static; }
}
@media (max-width: 900px) {
  .markup-layout { grid-template-columns: 1fr; }
  .markup-pages-panel, .markup-settings-card { position: static; }
  .markup-pages-panel .crop-page-list { display: flex; max-height: none; overflow-x: auto; }
  .markup-pages-panel .crop-page-thumb { min-width: 90px; width: 90px; }
}
@media (max-width: 640px) {
  .markup-tools-row { align-items: stretch; }
  .zoom-buttons { width: 100%; border-right: 0; padding-right: 0; }
  .markup-control { flex: 1; justify-content: space-between; }
}


/* PDF Join / PDF to Word */
.join-layout, .word-layout { display: grid; grid-template-columns: minmax(0,1fr) 330px; gap: 14px; align-items: start; }
.join-settings-card, .word-settings-card { position: sticky; top: 18px; padding-bottom: 14px; }
.join-settings-card > .field, .join-settings-card > .settings-note, .join-settings-card > .btn, .join-settings-card > .result-box,
.word-settings-card > .field, .word-settings-card > .settings-note, .word-settings-card > .btn, .word-settings-card > .result-box { margin-left: 14px; margin-right: 14px; }
.join-list { padding: 14px; display: grid; gap: 9px; }
.join-item { display: grid; grid-template-columns: 30px 54px minmax(0,1fr) auto; align-items: center; gap: 11px; border: 1px solid var(--line); border-radius: 11px; background: #11161c; padding: 9px; }
.join-item img { width: 54px; height: 68px; object-fit: contain; background: #eee; border-radius: 6px; }
.join-order { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: #2a2118; color: var(--accent-2); font-size: 10px; font-weight: 900; }
.join-file-info { min-width: 0; }
.join-file-info strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.join-file-info span { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.join-actions { display: flex; gap: 5px; }
.word-pages { max-height: 68vh; }
.result-note { display: block; color: #9fb0a7; font-size: 10px; line-height: 1.45; }

@media (max-width: 900px) {
  .join-layout, .word-layout { grid-template-columns: 1fr; }
  .join-settings-card, .word-settings-card { position: static; }
  .side-nav { overflow-x: auto; scrollbar-width: thin; }
  .nav-button { flex: 0 0 auto; }
}
@media (max-width: 640px) {
  .join-item { grid-template-columns: 26px 44px minmax(0,1fr); }
  .join-item img { width: 44px; height: 58px; }
  .join-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .side-nav .nav-button { flex: 0 0 auto; }
}

.word-mode-switch { grid-template-columns: repeat(2, minmax(0,1fr)); }
.word-mode-switch button { white-space: normal; line-height: 1.2; }
