/* CamMaster home: the scanner's start screen, laid out like a scanning app.
   Desktop: a slim CamMaster menu on the left, a big import card, a row of
   scanner tools and the recent documents list.
   Phone: a search field, the import card with the camera button first, a
   4-column tool grid and the recents list (the tab bar with the camera
   button lives in style.css, on every page). */

.cm-home{display:grid;grid-template-columns:220px minmax(0,1fr);gap:22px;align-items:start;max-width:1180px;margin:0 auto}
.cm-main{min-width:0;display:flex;flex-direction:column;gap:18px}

/* ── left menu (desktop) ─────────────────────────────────────── */
.cm-side{position:sticky;top:calc(var(--header-h,64px) + 14px);background:var(--card);border:1px solid var(--border);border-radius:var(--radius-lg,16px);padding:12px 10px}
.cm-side-brand{display:flex;align-items:center;gap:10px;padding:4px 8px 12px;margin-bottom:6px;border-bottom:1px solid var(--border);color:var(--text);text-decoration:none}
.cm-side-brand img{width:30px;height:30px;border-radius:9px;flex-shrink:0}
.cm-side-brand b{display:block;font-size:15px;font-weight:800;line-height:1.15}
.cm-side-brand small{display:block;font-size:11px;color:var(--text-3);font-weight:600}
.cm-side-item{display:flex;align-items:center;gap:11px;width:100%;min-height:42px;padding:0 10px;border:0;border-radius:10px;background:none;color:var(--text-2);font:inherit;font-size:14px;font-weight:600;text-decoration:none;cursor:pointer;text-align:left}
.cm-side-item svg{width:20px;height:20px;flex-shrink:0;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.cm-side-item:hover{background:var(--card-2);color:var(--text)}
.cm-side-item[aria-current="page"]{background:var(--primary-soft);color:var(--primary)}
html[data-theme="light"] .cm-side-item[aria-current="page"]{color:var(--primary-hover)}
.cm-side-label{font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--text-3);padding:12px 10px 4px}
.cm-side-app{margin-top:12px;padding:14px 12px;border-radius:12px;background:var(--card-2);border:1px solid var(--border)}
.cm-side-app b{display:block;font-size:13.5px;margin-bottom:4px;color:var(--text)}
.cm-side-app p{font-size:12px;line-height:1.45;color:var(--text-3);margin:0 0 10px}
.cm-side-app button{width:100%;min-height:38px;border:0;border-radius:10px;background:var(--primary-fill,#cc4418);color:#fff;font:inherit;font-size:13px;font-weight:700;cursor:pointer}
.cm-side-app button:hover{filter:brightness(1.08)}

/* ── mobile search field ─────────────────────────────────────── */
.cm-search{display:none;align-items:center;gap:10px;width:100%;height:46px;padding:0 14px;border:1px solid var(--border);border-radius:14px;background:var(--card);color:var(--text-3);font:inherit;font-size:15px;text-align:left;cursor:text}
.cm-search svg{width:19px;height:19px;flex-shrink:0;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}

/* ── import card ─────────────────────────────────────────────── */
.cm-home .scanner-upload{max-width:none;margin:0}
.cm-home .upload-zone{position:relative;background:var(--card);border:2px dashed var(--border-strong);border-radius:20px;padding:26px 24px 20px;text-align:center;cursor:pointer;transition:border-color var(--t,.2s),background-color var(--t,.2s)}
.cm-home .upload-zone:hover,.cm-home .upload-zone.drag-over{border-color:var(--primary);background:var(--card-2);transform:none;box-shadow:none}
.cm-home .upload-zone:focus-visible{outline:3px solid var(--primary);outline-offset:3px}
.cm-art{display:block;width:132px;height:96px;margin:2px auto 10px}
.cm-art .pg{fill:var(--card-2);stroke:var(--border-strong);stroke-width:2}
.cm-art .ln{stroke:var(--text-3);stroke-width:3;stroke-linecap:round;opacity:.45}
.cm-art .fr{fill:none;stroke:var(--primary);stroke-width:3.5;stroke-linecap:round;stroke-linejoin:round}
.cm-art .sl{fill:var(--primary);opacity:.9}
@media (prefers-reduced-motion:no-preference){.cm-art .sl{animation:cmScanLine 2.6s ease-in-out infinite}}
@keyframes cmScanLine{0%,100%{transform:translateY(-22px)}50%{transform:translateY(22px)}}
.cm-home .uz-title{font-size:20px;font-weight:800;margin:0 0 6px;color:var(--text)}
.cm-home .uz-hint{font-size:14px;color:var(--text-3);margin:0 0 18px}
.cm-acts{display:grid;grid-template-columns:repeat(3,minmax(0,200px));justify-content:center;gap:12px}
.cm-act{display:flex;align-items:center;justify-content:center;gap:10px;min-height:52px;padding:8px 14px;border:1px solid var(--border);border-radius:14px;background:var(--card-2);color:var(--text);font:inherit;font-size:14.5px;font-weight:700;cursor:pointer;transition:border-color var(--t,.2s),transform var(--t,.2s)}
.cm-act:hover{border-color:var(--primary);color:var(--primary)}
.cm-act .cs-ic{width:32px;height:32px;border-radius:9px}
.cm-act .cs-ic svg{width:19px;height:19px}
.cm-act-main{background:var(--primary-fill,#cc4418);border-color:transparent;color:#fff}
.cm-act-main:hover{color:#fff;border-color:transparent;filter:brightness(1.07)}
.cm-act-main .cs-ic{background:rgba(255,255,255,.18)!important}
.cm-act-main .cs-ic svg{stroke:#fff}
.cm-act-main .cs-ic svg .f{fill:#fff}
.cm-act-main .cs-ic svg .w{fill:var(--primary-fill,#cc4418)}
.cm-home #resumeEditor{margin:12px auto 0}

/* ── tool row / grid ─────────────────────────────────────────── */
.cm-block{background:var(--card);border:1px solid var(--border);border-radius:var(--radius-lg,16px);padding:16px 16px 12px}
.cm-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 10px}
.cm-head h2{font-size:16px;font-weight:800;margin:0;color:var(--text)}
.cm-head a,.cm-head button{font:inherit;font-size:13px;font-weight:700;color:var(--primary);text-decoration:none;background:none;border:0;cursor:pointer;padding:6px 2px}
.cm-head a:hover,.cm-head button:hover{text-decoration:underline}
.cm-tools{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:4px}
.cm-tool{display:flex;flex-direction:column;align-items:center;gap:8px;padding:10px 4px;border:0;border-radius:12px;background:none;color:var(--text-2);font:inherit;font-size:12.5px;font-weight:600;line-height:1.25;text-align:center;text-decoration:none;cursor:pointer}
.cm-tool:hover{background:var(--card-2);color:var(--text)}
.cm-tool .cs-ic{width:52px;height:52px;border-radius:15px}
.cm-tool .cs-ic svg{width:27px;height:27px}
/* the two slate icons need a lighter ink on the dark theme */
html[data-theme="dark"] .cm-tool .cs-ic[style*="#475569"],html[data-theme="dark"] .cm-tool .cs-ic[style*="#334155"]{--ic-fg:#a3b1c6!important}

/* ── recent documents ────────────────────────────────────────── */
.cm-recent .recent-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-bottom:4px}
.cm-recent .doc-card{display:grid;grid-template-columns:52px minmax(0,1fr);align-items:center;gap:12px;padding:8px 10px;border:1px solid var(--border);border-radius:12px;background:var(--card-2);cursor:pointer;transform:none;box-shadow:none}
.cm-recent .doc-card:hover{border-color:var(--primary);transform:none;box-shadow:none}
.cm-recent .doc-thumb{width:52px;height:52px;aspect-ratio:auto;border-radius:12px;overflow:hidden;display:grid;place-items:center;font-size:24px;background:none}
.cm-recent .doc-thumb .cs-ic{width:52px;height:52px;border-radius:12px}
.cm-recent .doc-thumb .cs-ic svg{width:28px;height:28px}
.cm-recent .doc-badge{display:none}
.cm-recent .doc-info{padding:0;min-width:0}
.cm-recent .doc-name{font-size:14px;margin:0 0 3px}
.cm-recent .doc-meta{font-size:12px}
.cm-recent .empty-state{padding:22px 12px}
.cm-recent .empty-state .es-icon{font-size:36px;margin-bottom:8px}

/* home page: page heading above the import card */
.cm-hello h1{font-size:22px;line-height:1.25;font-weight:800;margin:0 0 4px;color:var(--text)}
.cm-hello p{font-size:14px;color:var(--text-3);margin:0}
.cm-home-site{margin-bottom:22px}
/* on the home page the menu scrolls with the page (its content box is the scroller, so sticky offsets misplace it) */
.cm-home-site .cm-side{position:static}
@media (max-width:640px){.cm-hello h1{font-size:18px}.cm-hello p{font-size:13px}}

/* tablets: the menu folds away */
@media (max-width:1000px){
  .cm-home{grid-template-columns:minmax(0,1fr)}
  .cm-side{display:none}
  .cm-tools{grid-template-columns:repeat(4,minmax(0,1fr))}
}
/* phones: an app-like start screen */
@media (max-width:640px){
  .cm-main{gap:14px}
  .cm-search{display:flex}
  .cm-home .upload-zone{border-style:solid;border-width:1px;border-color:var(--border);border-radius:18px;padding:18px 14px 14px}
  .cm-art{width:96px;height:70px;margin-bottom:6px}
  .cm-home .uz-title{font-size:18px}
  .cm-home .uz-hint{font-size:13px;margin-bottom:14px}
  .cm-home .uz-drop{display:none}
  .cm-acts{grid-template-columns:1fr 1fr;gap:10px}
  .cm-act-main{grid-column:1 / -1;min-height:56px;font-size:16px}
  .cm-act{min-height:50px;font-size:14px;padding:8px 10px}
  .cm-block{padding:14px 10px 8px;border-radius:16px}
  .cm-head{padding:0 4px}
  .cm-tools{gap:2px}
  .cm-tool{font-size:12px;padding:8px 2px}
  .cm-tool .cs-ic{width:50px;height:50px;border-radius:14px}
  .cm-recent .recent-grid{grid-template-columns:minmax(0,1fr)}
}

/* Inside the installed CamMaster app the web page title and the long guide
   are left out: the app opens straight on the scanner and its tools. */
html.cm-app body > div:has(> div > h1),html.cm-app .tool-seo-section{display:none}
html.cm-app .cm-home{margin-top:8px}
