:root {
  --paper: #f4f5f3;
  --card: #fff;
  --ink: #252c27;
  --muted: #68736c;
  --line: #dde1db;
  --accent: #465f4b;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Consolas, monospace;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button { font: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 3px solid #809d84; outline-offset: 4px; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
.svg-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { display: block; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.site-header { max-width: 1064px; margin: auto; padding: 0 32px; height: 76px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.brand-mark { display: flex; align-items: center; gap: 11px; font-size: 17px; font-weight: 650; letter-spacing: -.4px; }
.brand-mark .icon { width: 25px; height: 25px; stroke-width: 1.7; }
.model-note { color: var(--muted); font-size: 12px; }
main { max-width: 1064px; margin: auto; padding: 38px 32px 0; }
.intro { margin-bottom: 26px; }
h1 { font-size: 25px; font-weight: 600; letter-spacing: -.7px; line-height: 1.25; margin: 0 0 8px; }
.intro > p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.lab { display: grid; grid-template-columns: 1.45fr 1fr; gap: 18px; align-items: stretch; }
.panel { border: 1px solid var(--line); border-radius: 9px; background: var(--card); }
.input-panel { padding: 20px; }
.panel-top { display: flex; align-items: center; justify-content: space-between; height: 25px; margin-bottom: 16px; }
.panel-top > h2 { margin: 0; font-size: 12px; font-weight: 600; }
.reset-button { display: flex; align-items: center; gap: 5px; padding: 4px 0 4px 8px; font-size: 11px; color: var(--muted); border: 0; background: transparent; }
.reset-button .icon { width: 15px; height: 15px; }
.reset-button:hover:not(:disabled) { color: var(--ink); }
.drop-zone { aspect-ratio: 1.55; position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; border: 1px dashed #c5cbc2; border-radius: 5px; background: #f8f9f6; cursor: pointer; transition: background .2s, border-color .2s; }
.drop-zone:hover { background: #f1f4ee; border-color: #99a894; }
.drop-zone.dragging { background: #e8eee3; border: 2px solid var(--accent); }
.drop-zone.has-media { background: #eef0eb; border-style: solid; }
.drop-zone > img, .drop-zone > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; color: var(--muted); }
.empty-state > .icon { width: 34px; height: 34px; margin-bottom: 18px; color: #919b8d; stroke-width: 1.3; }
.empty-state strong { font-weight: 500; font-size: 13px; color: #535d50; margin-bottom: 5px; }
.empty-state > span { font-size: 12px; }
.empty-state > small { font-size: 10px; color: #6f786b; margin-top: 27px; }
.controls-dock { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 14px; }
.button { min-height: 42px; display: flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid #d4dacf; border-radius: 5px; padding: 10px 12px; font-size: 12px; font-weight: 500; background: white; color: #44513f; transition: background .15s, border-color .15s; }
.button > .icon { width: 18px; height: 18px; }
.button:hover:not(:disabled) { border-color: #a0ad99; background: #f3f6ef; }
.button:active:not(:disabled) { transform: translateY(1px); }
.source-button[aria-pressed=true] { border-color: #879c7c; background: #eef4e8; }
.classify-button { grid-column: 1 / -1; border-color: var(--accent); background: var(--accent); color: #fff; min-height: 44px; }
.classify-button:hover:not(:disabled) { background: #354d3a; border-color: #354d3a; }
.classify-button:disabled { border-color: #e2e6de; background: #e7ebe3; color: #a0a89a; }
.input-status { font-size: 10px; line-height: 1.5; color: #6b7564; margin: 13px 0 0; min-height: 15px; }
.media-badge { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; align-items: center; padding: 6px 8px; font-size: 10px; color: white; border-radius: 3px; background: #2b342be0; z-index: 2; }
.media-badge .icon { width: 14px; height: 14px; }
.frame-dots { display: none; }
.camera-overlay { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; z-index: 2; }
.viewfinder { width: 68%; height: 63%; border: 1px solid #ffffffb0; border-radius: 3px; box-shadow: 0 0 0 200px #0002; }
.live-dot { position: absolute; top: 15px; right: 15px; width: 6px; height: 6px; background: #ef7b63; border-radius: 50%; box-shadow: 0 0 0 3px #ffffff4d; }
.prepare-overlay { display: none; position: absolute; inset: 0; background: #f8f9f6dc; z-index: 4; align-items: center; justify-content: center; }
.spinner, .button-spinner { display: block; width: 23px; height: 23px; border: 2px solid #d1dbca; border-top-color: var(--accent); border-radius: 50%; animation: spin .85s linear infinite; }
.button-spinner { display: none; width: 16px; height: 16px; border-color: #ccd4c5; border-top-color: #5c7755; }
.error { display: flex; gap: 9px; align-items: flex-start; margin-top: 12px; padding: 10px 12px; border: 1px solid #ecd3c8; border-radius: 4px; background: #fbf3ee; color: #975743; }
.error > .icon { width: 17px; height: 17px; }
.error > p { margin: 0; font-size: 11px; line-height: 1.55; }
.result-panel { padding: 20px; display: flex; flex-direction: column; }
.result-status { font-size: 10px; color: #6d7866; }
.result-content { padding: 48px 0 33px; }
.result-symbol { display: grid; place-items: center; width: 43px; height: 43px; border: 1px solid #dce2d5; border-radius: 5px; background: #f6f8f3; color: #89967f; margin-bottom: 19px; }
.result-symbol > .icon { width: 23px; height: 23px; stroke-width: 1.5; }
.result-spinner { display: none; }
#result-title { margin: 0 0 8px; font-size: 28px; font-weight: 550; letter-spacing: -.9px; line-height: 1.15; }
.result-description { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; max-width: 280px; }
.probability-section { margin-top: auto; }
.probability-label { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: #63705b; font-size: 11px; }
.probability-label > strong { font-size: 17px; color: var(--ink); font-weight: 550; font-variant-numeric: tabular-nums; }
.probability-track { height: 5px; position: relative; background: #e5eade; border-radius: 2px; margin-top: 14px; }
#probability-fill { display: block; height: 100%; width: 0; border-radius: 2px; background: #607f55; transition: width .4s; }
#probability-marker { display: none; }
.probability-ends { display: flex; justify-content: space-between; margin-top: 8px; font-size: 9px; color: #6d7866; }
.result-meta { margin: 27px 0 0; border-top: 1px solid var(--line); padding: 15px 0 0; display: grid; gap: 12px; }
.result-meta > div { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.result-meta dt { font-size: 11px; color: var(--muted); }
.result-meta dd { margin: 0; font: 11px var(--mono); color: #46523d; }
.estimate-note { margin: 21px 0 0; font-size: 10px; line-height: 1.5; color: #6d7866; }
.result-panel[data-state=hotdog] .result-symbol { color: #527044; border-color: #d4e0cb; background: #eef5e7; }
.result-panel[data-state=not-hotdog] .result-symbol { color: #957754; border-color: #e8ddcc; background: #f8f2e9; }
.result-panel[data-state=not-hotdog] #probability-fill { background: #a48763; }
.result-panel[data-state=loading] .result-symbol > .icon { display: none; }
.result-panel[data-state=loading] .result-spinner { display: block; }
.result-panel[data-state=error] .result-symbol { color: #a55e46; background: #fbf2ed; border-color: #eed8ca; }
footer { margin: 23px 0 30px; font-size: 10px; line-height: 1.6; color: #6d7866; }
body.busy .drop-zone { cursor: wait; }
body.busy .classify-button > .icon { display: none; }
body.busy .button-spinner { display: block; }
body.preparing .prepare-overlay { display: flex; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 760px) {
  .site-header { padding: 0 22px; height: 64px; }
  main { padding: 29px 22px 0; }
  .lab { grid-template-columns: 1.2fr 1fr; gap: 12px; }
  .input-panel, .result-panel { padding: 16px; }
  .drop-zone { aspect-ratio: 1.15; }
  .empty-state > small { font-size: 9px; }
  .result-content { padding-top: 30px; }
  #result-title { font-size: 25px; }
}
@media (max-width: 580px) {
  .site-header { padding: 0 18px; height: 58px; }
  .brand-mark { font-size: 16px; gap: 8px; }
  .brand-mark .icon { width: 22px; height: 22px; }
  .model-note { font-size: 11px; }
  main { padding: 25px 18px 0; }
  .intro { margin-bottom: 20px; }
  h1 { font-size: 23px; }
  .intro > p { font-size: 12px; }
  .lab { grid-template-columns: 1fr; gap: 14px; }
  .drop-zone { aspect-ratio: 1.5; }
  .panel-top { margin-bottom: 12px; }
  .controls-dock { margin-top: 12px; }
  .result-content { padding: 16px 0 24px; }
  .result-symbol { width: 35px; height: 35px; margin-bottom: 13px; }
  .result-symbol > .icon { width: 20px; height: 20px; }
  #result-title { font-size: 26px; }
  .result-meta { margin-top: 21px; }
  .estimate-note { margin-top: 17px; }
  footer { margin: 18px 0 24px; font-size: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *:before, *:after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
