/* CV Studio — ilova qobig'i. Tema tizim sozlamasiga ergashadi (yorug' standart, qorong'i — grafit). */
:root {
  color-scheme: light dark;
  --bg: #eef2f8; --bar: #ffffff; --surface: #ffffff; --surface-2: #f5f8fc;
  --line: rgba(22,28,40,.10); --line-2: rgba(22,28,40,.17); --hover: rgba(22,28,40,.055);
  --text: #1c2230; --heading: #161b26; --muted: #586174; --faint: #8a93a3;
  --accent: #2f76d2; --accent-soft: rgba(63,134,221,.12); --accent-line: rgba(63,134,221,.45); --accent-strong: #1b4f96;
  --shadow: 0 18px 44px -16px rgba(22,28,40,.28);
  --sheet-shadow: 0 .3mm .8mm rgba(22,28,40,.10), 0 3mm 9mm -2mm rgba(22,28,40,.18);
  --bar-h: 64px;
  --ui: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #2b313b; --bar: #343c48; --surface: #3a4250; --surface-2: #434c5b;
    --line: rgba(255,255,255,.09); --line-2: rgba(255,255,255,.16); --hover: rgba(255,255,255,.07);
    --text: #eceff4; --heading: #f6f2ea; --muted: #b1b8c5; --faint: #8a93a2;
    --accent: #8ab9ee; --accent-soft: rgba(138,185,238,.16); --accent-line: rgba(138,185,238,.5); --accent-strong: #dcebfc;
    --shadow: 0 20px 50px -16px rgba(0,0,0,.55);
    --sheet-shadow: 0 .3mm .8mm rgba(0,0,0,.2), 0 3mm 9mm -2mm rgba(0,0,0,.4);
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.4 var(--ui); overflow: hidden; }
button, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.bar {
  position: relative; z-index: 5; height: var(--bar-h);
  display: flex; align-items: center; gap: 18px; padding: 0 16px 0 18px;
  background: var(--bar); box-shadow: 0 1px 0 var(--line), 0 6px 18px -14px rgba(22,28,40,.35);
}
.bar::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--accent-line) 50%, transparent); }
.brand { display: flex; align-items: center; gap: 12px; flex: none; }
/* Tizim belgisi (shared/logo.svg) — fonsiz, o'zi kvadrat maydonni to'ldiradi */
.mark { width: 38px; height: 38px; flex: none; display: block; }
.mark img, .mark svg { display: block; width: 100%; height: 100%; }
.wordmark { display: grid; line-height: 1.05; }
.wordmark b { font: 600 19px/1.1 var(--serif); color: var(--heading); white-space: nowrap; }
.wordmark span { margin-top: 4px; font-size: 10px; font-weight: 650; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); white-space: nowrap; }

.tpls { display: inline-flex; gap: 4px; padding: 3px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2); }
.tpls button { border: 0; background: none; cursor: pointer; height: 30px; padding: 0 12px; border-radius: 9px; font-size: 12.5px; font-weight: 650; color: var(--muted); display: inline-flex; align-items: center; gap: 7px; }
.tpls button:hover { color: var(--text); }
.tpls button[aria-pressed="true"] { background: var(--surface); color: var(--accent-strong); box-shadow: 0 1px 3px rgba(22,28,40,.15), inset 0 0 0 1px var(--accent-line); }
.tpls .sw { width: 14px; height: 18px; border-radius: 3px; border: 1px solid var(--line-2); }

.actions { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.actions::-webkit-scrollbar { display: none; }
.actions > * { flex: none; }
.actions::before { content: ""; margin-left: auto; }
.vsep { width: 1px; height: 24px; background: var(--line); margin: 0 6px; }
.btn { height: 36px; padding: 0 13px; display: inline-flex; align-items: center; gap: 8px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); font-size: 13px; font-weight: 560; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--hover); }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn.ghost { border-color: transparent; background: none; color: var(--muted); padding: 0 10px; }
.btn.ghost:hover { color: var(--text); background: var(--hover); }
.btn.primary { border: 0; color: #fff; font-weight: 650; background: linear-gradient(180deg, #4b90e2, #2f76d2); box-shadow: 0 8px 20px -10px rgba(47,118,210,.9); }
.btn.primary:hover { background: linear-gradient(180deg, #5b9ce9, #3a80db); }
.sel { height: 36px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); font-size: 13px; font-weight: 560; cursor: pointer; }

.work { height: calc(100% - var(--bar-h)); display: grid; grid-template-columns: 1fr 1fr; }
.pane { position: relative; min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.pane + .pane { border-left: 1px solid var(--line); }
.scroll { flex: 1; min-height: 0; overflow: auto; padding: 40px 0 90px; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
  background: radial-gradient(1100px 500px at 50% -160px, rgba(28,107,107,.08), transparent 60%), var(--bg); }
.stage { position: relative; margin: 0 auto; }
.stage > .cv { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.pane.view .cv { pointer-events: none; }
/* namunadagi bino surati manbai — ekran uchun, hujjatga tushmaydi */
.img-credit {
  position: absolute; left: 16px; bottom: 10px; z-index: 3; margin: 0;
  font-size: 11px; line-height: 1.4; color: var(--faint);
  max-width: min(420px, calc(100% - 32px));
}
.img-credit a { color: inherit; text-decoration: none; border-bottom: 1px dotted currentColor; }
.img-credit a:hover { color: var(--text); }

.pages { position: absolute; right: 16px; top: 12px; z-index: 3; font-size: 12px; color: var(--faint); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; }

.toast {
  position: fixed; left: 50%; bottom: 26px; z-index: 60; transform: translate(-50%, 20px); opacity: 0;
  display: flex; align-items: center; gap: 14px; padding: 11px 12px 11px 16px;
  background: var(--surface); color: var(--text); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow);
  width: max-content; max-width: calc(100vw - 32px); font-size: 13px; pointer-events: none;
  transition: opacity .2s, transform .25s cubic-bezier(.2,.8,.2,1);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast button { flex: none; border: 0; border-radius: 8px; padding: 6px 10px; cursor: pointer; background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 12.5px; }

.switch { display: none; }
@media (max-width: 1400px) { .btn.ghost .lbl { display: none; } }
@media (max-width: 1180px) {
  .work { grid-template-columns: 1fr; }
  .work.show-view .pane.edit, .work:not(.show-view) .pane.view { display: none; }
  .pane + .pane { border-left: 0; }
  .switch { display: inline-flex; }
  .btn.switch .lbl { display: inline; }
}
@media (max-width: 860px) { .wordmark, .vsep, .tpls .lbl { display: none; } .bar { gap: 8px; padding: 0 10px; } }
