:root {
  --paper: #eee5d4;
  --paper-light: #f8f4eb;
  --ink: #30261d;
  --muted: #706253;
  --line: #cbbda6;
  --wine: #782c36;
  --gold: #987644;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: Arial, Helvetica, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.55 var(--sans); }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-underline-offset: 4px; }
button { cursor: pointer; }
button:disabled { cursor: wait; }
button:disabled, input:disabled, textarea:disabled, select:disabled { opacity: .6; }
input, textarea, select {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 46px;
  padding: 11px 12px;
  border: 1px solid #b8a992;
  border-radius: 4px;
  background: #faf7f0;
  color: var(--ink);
  font-size: 16px;
}
select { padding-right: 27px; }
textarea { resize: vertical; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: #827668; opacity: 1; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--wine); outline-offset: 2px; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid var(--wine); outline-offset: 4px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; }
h1 { font-size: clamp(40px, 5.5vw, 74px); line-height: 1.07; letter-spacing: -1.8px; }
h1 em { color: var(--wine); font-weight: 400; }
h2 { font-size: 28px; line-height: 1.18; }
h3 { font-size: 22px; line-height: 1.25; }
p, label, legend, button { overflow-wrap: anywhere; }

.masthead { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 94px; padding: 18px max(5vw, 20px); background: var(--ink); color: #f2e5c8; }
.brand { display: flex; flex-direction: column; line-height: 1.05; text-decoration: none; }
.brand-word { font: 700 27px/1 var(--serif); letter-spacing: 4px; }
.brand-small { margin-top: 6px; font-size: 9px; letter-spacing: 3.9px; }
.back { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; font-size: 13px; text-decoration: none; }
.skip { position: fixed; top: -200px; z-index: 5; padding: 12px; background: white; }
.skip:focus { top: 10px; }
main { max-width: 1400px; margin: 0 auto; padding: 0 5vw; }
.intro { padding: 45px 0 29px; border-bottom: 1px solid var(--line); }
.eyebrow { color: var(--muted); font: 700 10px/1.5 var(--sans); letter-spacing: 1.8px; }
.intro > .eyebrow { margin-bottom: 19px; }
.intro-row { display: grid; grid-template-columns: 1.4fr 1fr; align-items: end; gap: 50px; }
.intro-row > p { max-width: 390px; padding-bottom: 7px; color: var(--muted); font-size: 17px; }
.intro-meta { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 25px; color: var(--muted); font-size: 12px; }
.intro-meta span + span::before { content: '•'; margin-right: 24px; color: var(--gold); }

.workspace { display: grid; grid-template-columns: minmax(310px, .8fr) minmax(0, 1.5fr); gap: 40px; align-items: start; padding-top: 34px; }
.application { min-width: 0; padding-right: 32px; border-right: 1px solid var(--line); }
.application h2 { margin: 10px 0 26px; }
.form-field { min-width: 0; margin-top: 19px; }
.form-field:first-child { margin-top: 0; }
.form-field > label, .editor-fields > label { display: block; margin: 0 0 7px; font-size: 13px; font-weight: 700; line-height: 1.45; }
.hint { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.choice-panel { margin-top: 24px; padding: 18px 15px; border: 1px solid #d2c4af; border-radius: 5px; background: #f4eddf; }
.choice-panel .form-field + .form-field { margin-top: 16px; }
fieldset { min-width: 0; margin: 23px 0 22px; padding: 0; border: 0; }
legend { margin-bottom: 11px; padding: 0; font-size: 13px; font-weight: 700; }
.mode-options { display: grid; gap: 8px; }
.mode { display: flex; align-items: center; gap: 12px; min-height: 66px; padding: 12px; border: 1px solid var(--line); border-radius: 4px; background: #f5eddf; cursor: pointer; }
.mode:has(input:checked) { border-color: var(--wine); background: #f7eee5; box-shadow: inset 3px 0 var(--wine); }
.mode input { flex: 0 0 18px; width: 18px; height: 18px; min-height: 18px; margin: 0; padding: 0; accent-color: var(--wine); }
.mode > span { min-width: 0; }
.mode strong { display: block; font-size: 13px; }
.mode strong span { margin-left: 6px; color: var(--gold); }
.mode small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }

.primary, .secondary { min-height: 47px; padding: 12px 16px; border: 1px solid var(--wine); border-radius: 4px; font-size: 13px; font-weight: 700; line-height: 1.45; }
.primary { background: var(--wine); color: white; box-shadow: 0 2px 0 #57222a; }
.primary:hover:not(:disabled) { background: #63242d; }
.primary span { margin-left: 12px; }
.secondary { border-color: #bba98e; background: transparent; color: var(--ink); }
.secondary:hover:not(:disabled) { background: #e6d8c1; }
.submit-area { margin-top: 23px; }
#generate { display: flex; justify-content: space-between; align-items: center; width: 100%; text-align: left; }
.service-status { min-height: 34px; margin-top: 12px; color: var(--muted); font-size: 12px; }
.error { margin-top: 12px; padding: 11px 12px; border-left: 3px solid #8a1725; background: #f7e5de; color: #8a1725; font-size: 13px; }

details { margin-top: 22px; border-top: 1px solid var(--line); }
summary { display: flex; justify-content: space-between; align-items: center; gap: 14px; min-height: 51px; padding: 15px 0; font-size: 13px; font-weight: 700; line-height: 1.4; list-style: none; cursor: pointer; }
summary::-webkit-details-marker { display: none; }
summary > span { flex: 0 0 auto; color: var(--wine); font-size: 19px; font-weight: 400; line-height: 1; }
details[open] > summary > span { transform: rotate(45deg); }
.form-details { margin-top: 0; }
.form-details:last-of-type { border-bottom: 1px solid var(--line); }
.details-content { padding: 4px 1px 20px; }
.examples { margin-top: 27px; padding-top: 22px; border-top: 1px dashed var(--line); }
.examples h3 { margin: 6px 0 7px; }
.examples > p:not(.eyebrow) { color: var(--muted); font-size: 12px; }
#example-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 13px; }
.examples button { min-width: 0; min-height: 44px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 22px; background: #f7f0e4; color: var(--ink); font-size: 12px; line-height: 1.4; text-align: left; }
.examples button:hover:not(:disabled) { border-color: var(--gold); background: var(--paper-light); }

.result { min-width: 0; scroll-margin-top: 22px; }
.result-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.result-heading > div { min-width: 0; }
.result-heading h2 { margin-top: 9px; font-size: 25px; }
.tag { flex: 0 0 auto; max-width: 45%; padding: 5px 8px; border: 1px solid var(--gold); color: #765a31; font-size: 9px; line-height: 1.4; letter-spacing: 1px; text-align: center; overflow-wrap: anywhere; }
.paper-stage { margin-top: 23px; padding: 20px; border: 1px solid #d2c1a4; border-radius: 4px; background: #dfd1ba; box-shadow: inset 0 1px 20px #8c69390b; }
canvas { display: block; width: 100%; height: auto; aspect-ratio: 2100 / 1485; background: #f9f3e6; box-shadow: 0 12px 22px -13px #35241877, 0 1px 4px #35241833; }
.result-status { min-height: 20px; margin: 16px 0 10px; color: var(--muted); font-size: 13px; }
.committee-note { margin: 0 0 19px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.committee-note strong { color: var(--ink); }
.variation-actions { display: flex; align-items: center; gap: 14px; }
.variation-actions button { flex: 0 0 auto; }
.variation-actions button span { margin-left: 8px; }
.variation-actions .hint { max-width: 225px; margin: 0; }
.history { display: flex; flex-wrap: wrap; gap: 8px; }
.history:empty { display: none; }
.history:not(:empty) { margin-top: 19px; padding-top: 15px; border-top: 1px dashed var(--line); }
.history:not(:empty)::before { content: 'Předchozí návrhy'; flex: 0 0 100%; margin-bottom: 1px; color: var(--muted); font-size: 12px; font-weight: 700; }
.history button { max-width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 4px; background: var(--paper-light); color: var(--ink); font-size: 12px; line-height: 1.4; text-align: left; }
.history button:hover:not(:disabled), .history button[aria-pressed='true'], .history button[aria-current='true'] { border-color: var(--wine); background: #f7eee5; }
.export-panel { margin-top: 24px; padding: 18px; border: 1px solid var(--line); border-radius: 5px; background: #f4eddf; }
.quality-field select { max-width: 380px; }
.actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 17px; }
.actions > button { min-width: 0; }
.actions .primary { flex: 1 1 170px; }
.actions .secondary { flex: 1 1 95px; }
.editor-fields { padding: 0 1px 19px; }
.editor-fields > label { margin-top: 17px; }
.transcript { margin-top: 0; }
.transcript p { margin: 0 0 10px; font-size: 13px; overflow-wrap: anywhere; }
#diploma-text { padding-bottom: 10px; }

.about { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; margin-top: 48px; padding: 35px 0; border-top: 1px solid var(--line); }
.about h2 { margin-top: 11px; }
.about > div > p:not(.eyebrow) { color: var(--muted); font-size: 14px; }
.about > div > .privacy { margin-top: 13px; font-size: 12px; }
footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 20px; padding: 14px 5vw; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
footer > a { display: inline-flex; align-items: center; min-height: 44px; }
.no-js { padding: 25px; background: #f8d9d4; }

@media (min-width: 1500px) {
  main { padding-right: 40px; padding-left: 40px; }
}
@media (max-width: 1000px) {
  .workspace { grid-template-columns: minmax(280px, .95fr) minmax(0, 1.2fr); gap: 26px; }
  .application { padding-right: 23px; }
  .intro-row { gap: 30px; }
  .intro-row > p { font-size: 15px; }
  .paper-stage { padding: 12px; }
  .result-heading { align-items: flex-start; }
  .result-heading h2 { font-size: 23px; }
  .variation-actions { display: block; }
  .variation-actions .hint { max-width: none; margin-top: 8px; }
  .export-panel { padding: 15px; }
}
@media (max-width: 760px) {
  .masthead { min-height: 76px; padding: 14px 5vw; }
  .intro { padding: 30px 0 24px; }
  .intro-row { display: block; }
  .intro-row > p { max-width: 550px; margin-top: 18px; padding: 0; font-size: 16px; }
  .intro-meta { margin-top: 21px; }
  .workspace { display: flex; flex-direction: column; gap: 35px; padding-top: 27px; }
  .application { width: 100%; padding: 0; border-right: 0; }
  .application h2 { margin-bottom: 22px; font-size: 27px; }
  .application h2 br { display: none; }
  .choice-panel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 15px; }
  .choice-panel .form-field + .form-field { margin-top: 0; }
  .mode-options { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .form-field > label, .editor-fields > label, legend, summary { font-size: 14px; }
  .examples { margin-top: 24px; }
  .result { width: 100%; padding-top: 26px; border-top: 1px solid var(--line); }
  .result-heading { align-items: center; }
  .result-heading h2 { font-size: 26px; }
  .paper-stage { margin-top: 19px; }
  .variation-actions { display: flex; }
  .variation-actions .hint { margin: 0; }
  .about { gap: 25px; margin-top: 35px; padding-top: 28px; }
  .about h2 { font-size: 25px; }
}
@media (max-width: 520px) {
  h1 { font-size: clamp(38px, 9.5vw, 48px); letter-spacing: -1.1px; }
  .intro-meta { gap: 7px 12px; font-size: 11px; }
  .intro-meta span + span::before { margin-right: 12px; }
  .choice-panel { display: block; padding: 16px 13px; }
  .choice-panel .form-field + .form-field { margin-top: 17px; }
  .mode-options { grid-template-columns: 1fr; }
  .paper-stage { padding: 8px; }
  .result-heading h2 { font-size: 23px; }
  .tag { max-width: 38%; padding: 5px 7px; font-size: 8px; }
  .variation-actions { display: block; }
  .variation-actions > button { width: 100%; }
  .variation-actions .hint { margin-top: 8px; }
  .export-panel { padding: 14px 12px; }
  .actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .actions .primary { grid-column: 1 / -1; }
  .actions > button { padding: 12px 10px; font-size: 13px; }
  .about { display: block; }
  .about > div + div { margin-top: 19px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
@page { size: A4 landscape; margin: 0; }
@media print {
  body { background: white; }
  .masthead, .intro, .application, .result-heading, .result-status,
  .committee-note, .variation-actions, .history, .export-panel,
  .editor, .transcript, .about, footer, .skip, noscript { display: none !important; }
  main, .workspace, .result, .paper-stage { display: block; position: static; width: 100%; max-width: none; margin: 0; padding: 0; border: 0; background: white; box-shadow: none; }
  canvas { width: 297mm; height: 210mm; box-shadow: none; object-fit: contain; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
/* Vizuální vrstva diplomové kanceláře. Platí jen na obrazovce: plátno a tisk listiny zůstávají původní. */
@media screen {
  :root { --paper:#071820; --paper-light:#102f37; --ink:#e8fcfa; --muted:#b4d0ce; --line:#2b6267; --wine:#63e8d2; --gold:#dfbd7b; }
  body { background: radial-gradient(ellipse at 90% 0%,#124a50,transparent 32rem), linear-gradient(160deg,#071c25,#061217 65%,#102c31); color:var(--ink); }
  body::before { content:""; position:fixed; inset:0; z-index:-1; pointer-events:none; opacity:.23; background-image:linear-gradient(#62ecd611 1px,transparent 1px),linear-gradient(90deg,#62ecd611 1px,transparent 1px); background-size:48px 48px; }
  .masthead { background:#05151ddf; color:#e6fff9; border-bottom:1px solid #397981; box-shadow:0 6px 32px #0006; }
  .brand-word { color:#f1fffb; letter-spacing:.15em; }
  .brand-small,.back { color:#b3ddd7; }
  .brand::before { content:"✧"; position:absolute; color:#77fce2; opacity:.7; transform:translate(-1.1em,.25em); font-size:1.2em; }
  .brand { position:relative; margin-left:1.4em; }
  .intro { position:relative; border-color:var(--line); }
  .intro::after { content:""; position:absolute; right:0; top:18px; width:130px; height:130px; z-index:-1; pointer-events:none; border:1px solid #76f5db45; border-radius:50%; background:radial-gradient(circle,transparent 30%,#63f6df22 31%,transparent 33%,transparent 55%,#63f6df22 56%,transparent 57%); box-shadow:0 0 34px #54f7e51a; animation:office-orbit 32s linear infinite; }
  .eyebrow { color:#7df7df; font-family:monospace; letter-spacing:.16em; }
  h1,h2,h3 { color:#effffb; }
  h1 em { color:#78f3df; }
  .intro-row > p,.intro-meta,.hint,.result-status,.committee-note,.about > div > p:not(.eyebrow),footer,.examples > p:not(.eyebrow) { color:var(--muted); }
  .application,.result { border-color:var(--line); }
  .workspace { gap:clamp(24px,3vw,40px); }
  .choice-panel,.export-panel { background:linear-gradient(145deg,#123841,#0c2730); border-color:#336d70; box-shadow:inset 0 1px #9affdf1c; }
  input,textarea,select { background:#0b242b; color:#f0fffc; border-color:#48817d; color-scheme:dark; }
  input::placeholder,textarea::placeholder { color:#a1bfbc; opacity:1; }
  input:focus,textarea:focus,select:focus,button:focus-visible,a:focus-visible,summary:focus-visible { outline-color:#7dffe3; }
  .mode { background:#0d2a31; border-color:#36686b; }
  .mode:has(input:checked) { background:#164a49; border-color:#7df4dc; box-shadow:inset 3px 0 #74f5d7,0 0 18px #64f8da18; }
  .mode input { accent-color:#71e8d1; }
  .mode small { color:#b4d0ce; }
  .mode strong span { color:#e6c68f; }
  .primary { background:#77f1d7; color:#062626; border-color:#aeffe8; box-shadow:0 3px 18px #39ead22c; }
  .primary:hover:not(:disabled) { background:#b1ffeb; }
  .secondary,.examples button,.history button { background:#10323a; color:#e9fffa; border-color:#3e7778; }
  .secondary:hover:not(:disabled),.examples button:hover:not(:disabled),.history button:hover:not(:disabled),.history button[aria-pressed='true'],.history button[aria-current='true'] { background:#1a514e; border-color:#78f2db; }
  .tag { color:#c8fff2; border-color:#55a79d; background:#174440; }
  .paper-stage { background:radial-gradient(circle,#22555b,#0b272e 70%); border-color:#4b8889; box-shadow:inset 0 0 22px #4bffdf12,0 10px 35px #0007; }
  /* Canvas pixel data and existing print rules are intentionally untouched. */
  .committee-note strong { color:#e8fcfa; }
  .error { background:#401e27; color:#ffd9d2; border-color:#ff9283; }
  .no-js { background:#402c22; color:#fff0dc; }
  .skip { background:#061e22; color:#fff; }
  summary > span { color:#79f9df; }
  .intro-meta span + span::before { color:#d8c083; }
  .primary, .secondary, .mode, input, textarea, select { border-radius:6px; }
  @keyframes office-orbit { to { transform:rotate(360deg); } }
  @media (max-width:760px) { .intro::after { width:94px; height:94px; opacity:.5; } }
  @media (prefers-reduced-motion:reduce) { .intro::after { animation:none; } }
}

/* Palubní odezva aplikace. Grafika listiny a tisk zůstávají mimo tuto vrstvu. */
@media screen {
  /* Bod je součástí již existující rotující radarové vrstvy. */
  .intro::after {
    background:
      radial-gradient(circle 3px at 50% 2%, #effffa 0 30%, #82ffea 55%, transparent 100%),
      radial-gradient(circle, transparent 30%, #63f6df22 31%, transparent 33%, transparent 55%, #63f6df22 56%, transparent 57%);
    filter: drop-shadow(0 0 4px #7dffecaa);
    opacity: .9;
  }
  @media (max-width:760px) { .intro::after { opacity: .8; } }

  :is(.choice-panel,.export-panel,.mode,.paper-stage,.form-details,.editor,.form-field) {
    position: relative;
  }
  :is(.choice-panel,.export-panel,.mode,.paper-stage,.form-details,.editor,.form-field,.examples button,.history button).lz-office-touch {
    outline: 2px solid #9cffe9;
    outline-offset: -2px;
    box-shadow: inset 0 0 0 1px #91ffe8, 0 0 18px #5bffe47a;
  }
  .lz-office-target {
    outline: 3px solid #b8fff1;
    outline-offset: 2px;
    box-shadow: 0 0 13px #69ffe589;
  }
  @media (hover:hover) and (pointer:fine) {
    :is(.choice-panel,.export-panel,.mode,.paper-stage,.form-details,.editor,.form-field,.examples button,.history button):hover {
      outline: 1px solid #7fdfd3;
      outline-offset: -1px;
      box-shadow: 0 0 15px #5bffe441;
    }
  }
  :is(.choice-panel,.export-panel,.mode,.paper-stage,.form-details,.editor,.form-field):has(:focus-visible),
  :is(.examples button,.history button):focus-visible {
    outline: 2px solid #a3ffe9;
    outline-offset: 2px;
  }
  @supports ((-webkit-mask-composite: xor) or (mask-composite: exclude)) {
    :is(.choice-panel,.export-panel,.mode,.paper-stage,.form-details,.editor,.form-field)::after {
      content: "";
      position: absolute;
      inset: 0;
      z-index: 2;
      padding: 3px;
      border-radius: inherit;
      background: linear-gradient(105deg,#38d7c865 0%,#53f5dc 18%,#e6fffa 28%,#7cffe7 38%,#37d6cb77 55%,#4ff7dc 75%,#baffee 84%,#38d7c865 100%) 100% 0 / 230% 100% no-repeat;
      -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
      -webkit-mask-composite: xor;
      mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
      mask-composite: exclude;
      opacity: 0;
      pointer-events: none;
    }
    @media (prefers-reduced-motion:no-preference) {
      :is(.choice-panel,.export-panel,.mode,.paper-stage,.form-details,.editor,.form-field).lz-office-touch::after,
      :is(.choice-panel,.export-panel,.mode,.paper-stage,.form-details,.editor,.form-field):has(:focus-visible)::after {
        animation: lz-office-edge 700ms ease-out 1 both;
      }
      @media (hover:hover) and (pointer:fine) {
        :is(.choice-panel,.export-panel,.mode,.paper-stage,.form-details,.editor,.form-field):hover::after {
          animation: lz-office-edge 700ms ease-out 1 both;
        }
      }
      @keyframes lz-office-edge {
        0% { opacity:.75; background-position:100% 0; }
        40% { opacity:1; }
        100% { opacity:.8; background-position:0 0; }
      }
    }
  }
  @media (prefers-reduced-motion:reduce) {
    .intro::after { animation:none; }
    :is(.choice-panel,.export-panel,.mode,.paper-stage,.form-details,.editor,.form-field)::after { animation:none; }
  }
}
