/* Academy tools (resize-photo, pdf-tools, passport-photo, product-photo,
   photo-to-text, sharpen-photo, voice-to-text, cv-writer): one shared look,
   the same as remove-background.html. Each tool adds only its own bits. */
:root { --tk-check-a: #2a3350; --tk-check-b: #1c2440; }
[data-theme="light"] { --tk-check-a: #e6e9f0; --tk-check-b: #ffffff; }

.tk-header { padding: 32px 0 6px; }
.tk-header .container, .tk-app { max-width: 1040px; }
.tk-header .container { text-align: left; }
.tk-header h1 { font-size: clamp(1.75rem, 4.6vw, 3.1rem); letter-spacing: -0.02em; line-height: 1.04; margin: 8px 0 10px; }
.tk-header .lede { margin: 0; max-width: 60ch; }
.tk-crumb { display: flex; gap: 8px; font-size: 0.88rem; color: var(--text-muted); }
.tk-crumb a { color: var(--text-muted); text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--text-muted) 40%, transparent); }
.tk-crumb a:hover { color: var(--text); }
.tk-crumb [aria-current] { color: var(--text); }
.tk-section { padding: 18px 0 72px; }

/* Upload area */
.tk-drop {
  position: relative; display: grid; place-items: center; min-height: 300px; padding: 28px 20px; cursor: pointer; text-align: center;
  border-radius: 22px; border: 2px dashed color-mix(in srgb, var(--accent) 45%, var(--border));
  background: radial-gradient(70% 90% at 50% 40%, var(--surface) 30%, transparent 75%),
    repeating-conic-gradient(var(--tk-check-a) 0 25%, var(--tk-check-b) 0 50%) 0 0 / 28px 28px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.tk-drop.tk-plain { background: var(--surface); }
.tk-drop:hover, .tk-drop:focus-visible, .tk-drop.is-over { border-color: var(--accent); outline: none; }
.tk-drop.is-over { transform: scale(1.01); }
.tk-drop.is-busy { pointer-events: none; opacity: 0.6; }
.tk-drop[hidden] { display: none; }
.tk-drop-icon { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 18px; color: var(--accent-2); background: color-mix(in srgb, var(--accent) 16%, var(--bg-elevated)); }
.tk-drop-icon svg { width: 32px; height: 32px; }
.tk-drop-title { font-family: var(--font-head); font-size: 1.35rem; font-weight: 700; margin: 14px 0 4px; color: var(--text); }
.tk-drop-sub { margin: 0 0 16px; color: var(--text-muted); font-size: 0.93rem; }

.tk-status { margin: 16px 0 0; padding: 14px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.tk-status p { margin: 0; font-size: 0.95rem; display: flex; align-items: center; gap: 10px; }
.tk-status p::before { content: ""; width: 16px; height: 16px; flex-shrink: 0; border-radius: 50%; border: 2px solid var(--border); border-top-color: var(--accent-2); animation: tk-spin 0.8s linear infinite; }
@keyframes tk-spin { to { transform: rotate(360deg); } }
.tk-bar { height: 6px; border-radius: 6px; background: var(--surface-2); overflow: hidden; margin-top: 10px; }
.tk-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 0.2s ease; }
.tk-error { margin: 16px 0 0; padding: 12px 16px; border-radius: 14px; color: #ffb4b4; background: rgba(255, 107, 107, 0.1); border: 1px solid rgba(255, 107, 107, 0.4); }
[data-theme="light"] .tk-error { color: #b42318; }
.tk-status[hidden], .tk-error[hidden], .tk-bar[hidden], .tk-result[hidden], .tk-hide[hidden] { display: none; }

/* Result: work area + side panel */
.tk-result { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 20px; align-items: start; margin-top: 4px; }
@media (max-width: 860px) { .tk-result { grid-template-columns: minmax(0, 1fr); } }
.tk-result.tk-single { grid-template-columns: minmax(0, 1fr); }
.tk-stage { position: relative; border-radius: 18px; overflow: hidden; border: 1px solid var(--border); background: var(--surface); }
.tk-stage.tk-check { background: repeating-conic-gradient(var(--tk-check-a) 0 25%, var(--tk-check-b) 0 50%) 0 0 / 22px 22px; }
.tk-stage canvas, .tk-stage img { display: block; max-width: 100%; height: auto; margin: 0 auto; }
.tk-hint { margin: 8px 0 0; font-size: 0.82rem; color: var(--text-muted); text-align: center; }
.tk-panel { padding: 20px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); }
.tk-panel h2, .tk-panel .tk-h { font-size: 0.95rem; margin: 0 0 10px; font-family: var(--font-head); font-weight: 700; display: block; }
.tk-panel > * + h2, .tk-panel > * + .tk-h { margin-top: 18px; }
.tk-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tk-choice { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--bg-elevated); color: var(--text); font: inherit; font-size: 0.86rem; font-weight: 600; cursor: pointer; text-align: left; line-height: 1.25; }
.tk-choice small { display: block; font-weight: 500; color: var(--text-muted); font-size: 0.74rem; }
.tk-choice[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.tk-sw { width: 20px; height: 20px; border-radius: 6px; flex-shrink: 0; box-shadow: inset 0 0 0 1px rgba(127, 127, 127, 0.45); }
.tk-field { display: grid; gap: 6px; margin-bottom: 12px; }
.tk-field label { font-size: 0.84rem; font-weight: 600; }
.tk-field input, .tk-field select, .tk-field textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--text); background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 10px; padding: 9px 11px;
}
.tk-field textarea { min-height: 90px; resize: vertical; }
.tk-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tk-range { width: 100%; accent-color: var(--accent); }
.tk-range-labels { display: flex; justify-content: space-between; margin: 2px 0 12px; font-size: 0.76rem; color: var(--text-muted); }
.tk-actions { display: grid; gap: 8px; margin-top: 16px; }
.tk-actions .btn { width: 100%; }
.tk-note { margin: 10px 0 0; font-size: 0.8rem; color: var(--text-muted); }
.tk-again { margin-top: 14px; width: 100%; padding: 10px; border-radius: 12px; border: 1px dashed var(--border); background: transparent; color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.tk-again:hover { border-color: var(--accent); }
.tk-check-row { display: flex; align-items: center; gap: 8px; font-size: 0.88rem; margin-bottom: 8px; }

.tk-facts { list-style: none; margin: 22px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 22px; font-size: 0.9rem; color: var(--text-muted); }
.tk-facts strong { color: var(--text); }
@media (max-width: 760px) { .tk-facts { grid-template-columns: minmax(0, 1fr); } .tk-drop { min-height: 240px; } .tk-header { padding-top: 20px; } }

/* File lists (resize, PDF) */
.tk-files { display: grid; gap: 8px; }
.tk-file { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px; border-radius: 12px; background: var(--bg-elevated); border: 1px solid var(--border); }
.tk-file img, .tk-file canvas, .tk-file .tk-thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; background: var(--surface-2); display: grid; place-items: center; font-size: 0.7rem; font-weight: 700; color: var(--text-muted); }
.tk-file-name { font-weight: 600; font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-file-meta { font-size: 0.8rem; color: var(--text-muted); }
.tk-file-meta b { color: var(--success); font-weight: 600; }
.tk-file-btns { display: flex; gap: 4px; }
.tk-icon-btn { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; display: grid; place-items: center; font: inherit; }
.tk-icon-btn:hover:not(:disabled) { border-color: var(--accent); }
.tk-icon-btn:disabled { opacity: 0.35; cursor: default; }
.tk-icon-btn svg { width: 16px; height: 16px; }

/* Tabs (PDF tools) */
.tk-tabs { display: flex; gap: 6px; padding: 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); width: fit-content; max-width: 100%; overflow-x: auto; margin: 0 0 16px; scrollbar-width: none; }
.tk-tab { flex: 0 0 auto; font: inherit; font-size: 0.9rem; font-weight: 600; color: var(--text-muted); background: transparent; border: 0; border-radius: 999px; padding: 9px 16px; cursor: pointer; }
.tk-tab[aria-selected="true"] { color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }

/* Text output (photo to text, voice to text) */
.tk-text { width: 100%; min-height: 320px; font: inherit; font-size: 1rem; line-height: 1.6; color: var(--text); background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; resize: vertical; }
@media (prefers-reduced-motion: reduce) { .tk-drop, .tk-bar span { transition: none; } .tk-status p::before { animation: none; } }
.tk-choice:has(small) { flex-direction: column; align-items: flex-start; gap: 2px; }
#vtRecord.is-rec { background: #dc2626; border-color: #dc2626; color: #fff; }

/* Free Tools page: "Made by the Academy" cards */
.at-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 6px 16px; margin-bottom: 14px; }
.at-head h2 { margin: 0; font-size: clamp(1.3rem, 2.6vw, 1.7rem); }
.at-head p { margin: 0; color: var(--text-muted); font-size: 0.92rem; }
.at-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.at-card { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 4px 12px; align-items: start; padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none; transition: border-color 0.2s ease, transform 0.2s ease; }
.at-card:hover, .at-card:focus-visible { border-color: var(--accent); transform: translateY(-2px); outline: none; }
.at-ic { grid-row: span 2; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; color: var(--accent-2); background: color-mix(in srgb, var(--accent) 15%, var(--bg-elevated)); }
.at-ic svg { width: 22px; height: 22px; }
.at-card strong { font-size: 0.98rem; }
.at-card span { font-size: 0.84rem; color: var(--text-muted); line-height: 1.4; }
@media (prefers-reduced-motion: reduce) { .at-card { transition: none; } }
