@font-face { font-family: Outfit; src: url('fonts/Outfit-Regular.woff2') format('woff2'); font-style: normal; font-weight: 400; font-display: swap; }
@font-face { font-family: Outfit; src: url('fonts/Outfit-SemiBold.woff2') format('woff2'); font-style: normal; font-weight: 600; font-display: swap; }
:root {
  font-family: Outfit, system-ui, sans-serif; color: #202b43; background: #f5f6fa; font-synthesis: none;
  --surface: #fff; --soft: #edf0f7; --accent: #3156df; --accent-strong: #2444be;
  --muted: #59657c; --border: #dce1ec; --radius: 14px; --monitor: #192842; --monitor-text: #bdcae1;
}
* { box-sizing: border-box; scrollbar-width: thin; scrollbar-color: #9aa6bd transparent; }
body { margin: 0; font-size: 16px; line-height: 1.5; }
button, input, select { font: inherit; }
button { cursor: pointer; transition: background .18s ease-out, color .18s ease-out, border-color .18s ease-out, transform .18s ease-out; }
button:disabled { cursor: not-allowed; background: #e9edf4; color: #67738a; border-color: #dce1ec; }
button:not(:disabled):active { transform: translateY(1px); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
::selection { background: #dce5ff; color: #17387e; }
input { caret-color: var(--accent); }
input::placeholder { color: #65728c; opacity: 1; }
[hidden] { display: none !important; }
a { color: var(--accent-strong); text-underline-offset: .2em; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 600; letter-spacing: -.025em; line-height: 1.2; }
h1 { font-size: 48px; letter-spacing: -.035em; max-width: 1040px; margin-inline: auto; text-wrap: balance; }
h1 span { color: var(--accent); }
h2 { font-size: 20px; }
h3 { font-size: 20px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 80px; padding: 16px max(32px, calc((100vw - 1280px) / 2)); background: var(--surface); border-bottom: 1px solid var(--border); }
.brand-group { display: flex; align-items: center; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-size: 23px; font-weight: 600; color: inherit; text-decoration: none; white-space: nowrap; letter-spacing: -.03em; }
.brand-icon { width: 36px; height: 36px; background: var(--accent); border-radius: 10px; display: grid; place-items: center; }
.brand-icon svg { width: 28px; fill: none; stroke: white; stroke-width: 2.3; stroke-linejoin: round; }
.app-kind { border-left: 1px solid var(--border); padding-left: 20px; font-size: 13px; color: var(--muted); }
.topbar nav { display: flex; align-items: center; gap: 8px; }
.text-button { border: 0; background: transparent; color: var(--muted); padding: 10px 12px; font-size: 14px; font-weight: 600; border-radius: 8px; min-height: 44px; }
.text-button:hover:not(:disabled) { color: var(--accent-strong); background: var(--soft); }
#save-project { color: var(--accent-strong); background: #edf1ff; padding-inline: 18px; }
#save-project:hover { background: #dfe7ff; }
.help-button { border: 1px solid var(--border); width: 44px; height: 44px; border-radius: 8px; background: var(--surface); color: var(--muted); font-size: 18px; }
.help-button:hover { background: var(--soft); }
main { width: 100%; max-width: 1344px; margin: auto; padding: 44px 32px 0; }
.intro { text-align: center; margin-bottom: 38px; }
.subtitle { margin-top: 12px; color: var(--muted); font-size: 17px; }
.local-badge { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); white-space: nowrap; margin-left: auto; }
.local-badge svg, .button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }
.project-row { display: flex; align-items: center; gap: 16px; margin: 0 0 18px; flex-wrap: wrap; }
.project-row input { width: 208px; min-width: 120px; padding: 7px 0; background: transparent; border: 0; border-bottom: 1px solid #b7c1d4; color: inherit; font-weight: 600; }
.project-row > span { font-size: 13px; color: var(--muted); }
.project-row #save-status::before { content: ''; display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: currentColor; margin-right: 7px; vertical-align: middle; }
.project-row .demo-badge { color: #795311; background: #fff0d0; padding: 5px 9px; border-radius: 6px; }
.source-panel { padding: 24px 28px; border-radius: var(--radius); background: var(--monitor); color: #fff; }
.source-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.source-head h2 { font-size: 23px; }
.source-actions { display: flex; gap: 12px; align-items: center; }
.source-panel .text-button { color: var(--monitor-text); }
.source-panel .text-button:hover { background: #2c3e5d; color: #fff; }
.source-panel :focus-visible { outline-color: #a4beff; }
.button { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 15px; font-weight: 600; padding: 11px 18px; border: 0; border-radius: 8px; white-space: nowrap; }
.primary { background: var(--accent); color: white; }
.primary:hover:not(:disabled) { background: var(--accent-strong); }
.dark { background: var(--monitor); color: white; }
.dark:hover:not(:disabled) { background: #2c4063; }
.full { width: 100%; }
.source-body { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.5fr); align-items: center; gap: 40px; margin-top: 12px; }
.connection-pill { display: inline-flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 600; }
.connection-pill::before { content: ''; height: 7px; width: 7px; background: #a0aec6; border-radius: 50%; }
.connection-pill.connected::before { background: #87dcbc; }
.connection-info p { font-size: 14px; color: var(--monitor-text); margin-top: 7px; max-width: 43ch; }
.connection-info .text-button { padding-left: 0; margin-top: 4px; text-decoration: underline; text-underline-offset: 4px; }
.signal-display { min-width: 0; border-left: 1px solid #35435c; padding-left: 32px; }
.signal-caption { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--monitor-text); }
#signal-state { color: #dbe5f8; }
.signal-display canvas { display: block; width: 100%; height: 76px; margin: 4px 0; }
.signal-legend { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 14px; color: var(--monitor-text); font-size: 12px; font-variant-numeric: tabular-nums; }
.signal-legend span { display: inline-flex; align-items: center; gap: 5px; }
.signal-legend i { width: 12px; height: 2px; background: var(--color); }
.workspace { display: grid; grid-auto-flow: dense; grid-template-columns: minmax(0, 1.25fr) minmax(0, .9fr) minmax(0, 1.05fr); gap: 28px; align-items: start; margin-top: 38px; }
.workspace > div { min-width: 0; }
.examples-column { grid-column: 1; grid-row: 1; }
.training-column { grid-column: 2; grid-row: 1; }
.preview-column { grid-column: 3; grid-row: 1; }
.column-heading { min-height: 80px; display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px 12px; margin-bottom: 14px; }
.column-heading h2 { display: flex; align-items: center; gap: 9px; }
.column-heading p { margin-top: 9px; font-size: 14px; color: var(--muted); max-width: 48ch; }
.step-number { display: inline-grid; place-items: center; width: 23px; height: 23px; flex-shrink: 0; border: 1px solid #c9d2e5; border-radius: 50%; font-size: 12px; color: var(--accent-strong); letter-spacing: 0; }
.step-count { font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.gesture-card { padding: 22px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 14px; }
.background-card { background: #eef1f8; }
.gesture-top { display: flex; align-items: center; gap: 12px; }
.gesture-name { flex: 1; min-width: 0; }
.gesture-name label { display: block; color: var(--muted); font-size: 13px; margin-bottom: 5px; }
.gesture-name input { width: 100%; min-width: 0; padding: 5px 0 8px; border: 0; border-bottom: 1px solid #aab5ca; background: transparent; color: inherit; font-size: 21px; font-weight: 600; letter-spacing: -.02em; }
.remove-button { align-self: flex-end; padding-right: 0; font-size: 12px; font-weight: 400; }
.duration-tag { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.gesture-description { font-size: 14px; color: var(--muted); margin: 12px 0 20px; max-width: 54ch; }
.record-details { margin: 0 0 20px; }
.record-details summary { min-height: 44px; padding: 10px 0; color: var(--accent-strong); font-size: 13px; cursor: pointer; }
.record-details summary span { float: right; margin-left: 16px; color: var(--muted); font-variant-numeric: tabular-nums; }
.record-options label { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--text); font-size: 13px; }
.record-options select { min-height: 44px; max-width: 100%; padding: 8px 10px; border: 1px solid #aab5ca; border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; }
.record-options input[type=number] { width: 76px; min-height: 44px; padding: 8px 10px; border: 1px solid #aab5ca; border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; }
.record-options { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; padding: 8px 0 12px; }
.record-options .duration-help { flex-basis: 100%; color: var(--muted); font-size: 12px; margin: 0 0 4px; }
.record-options .repeat-toggle { min-height: 44px; cursor: pointer; }
.repeat-toggle input { width: 18px; height: 18px; accent-color: var(--accent); }
.record-options select:disabled { color: var(--muted); background: var(--soft); cursor: not-allowed; }
.record-options input:disabled { color: var(--muted); background: var(--soft); cursor: not-allowed; }
.gesture-body { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 16px; }
.record-button { display: inline-flex; justify-content: center; align-items: center; gap: 9px; min-height: 44px; padding: 10px 13px; border: 1px solid #bcc9eb; border-radius: 8px; background: #f4f6fd; color: #2647b5; font-size: 14px; font-weight: 600; white-space: nowrap; }
.record-button:hover:not(:disabled) { background: #e4ebff; border-color: #93a9e5; }
.record-button i { width: 10px; height: 10px; border: 2px solid currentColor; border-radius: 50%; }
.record-button.recording { color: #a02d42; border-color: #ddadb6; background: #fff1f3; }
.record-button.recording i { border-radius: 2px; background: currentColor; }
.sample-side { flex: 1; min-width: 110px; }
.sample-count { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sample-strip { display: flex; align-items: center; gap: 4px; overflow: hidden; height: 30px; margin-top: 2px; }
.sample-thumb { flex-shrink: 0; border: 1px solid #d2daea; background: var(--soft); color: #4968b6; border-radius: 4px; padding: 2px; width: 30px; height: 26px; }
.sample-thumb:hover { border-color: var(--accent); transform: translateY(-2px); }
.sample-thumb svg { display: block; height: 20px; width: 24px; }
.sample-empty, .sample-more { font-size: 12px; color: var(--muted); }
.background-note { font-size: 12px; color: var(--muted); margin-top: 17px; }
.capture-feedback { margin-top: 18px; font-size: 14px; color: #2448a3; font-variant-numeric: tabular-nums; }
.capture-track { height: 4px; margin-top: 10px; background: #d3dcec; border-radius: 4px; overflow: hidden; }
.capture-track > div { height: 100%; background: var(--accent); width: 0; transition: width .08s linear; }
.add-class { display: flex; justify-content: center; align-items: center; gap: 8px; width: 100%; min-height: 48px; padding: 12px 16px; font-weight: 600; font-size: 14px; color: var(--accent-strong); border: 1px dashed #9eafd1; border-radius: 10px; background: transparent; }
.add-class svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.add-class:hover:not(:disabled) { background: #eaf0ff; border-color: var(--accent); }
.record-tip { font-size: 13px; color: var(--muted); margin-top: 14px; max-width: 56ch; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.training-card { padding: 24px; text-align: left; }
.training-symbol { width: 56px; height: 48px; margin: 2px 0 24px; fill: var(--surface); stroke: #6c83c7; stroke-width: 1.5; }
.training-card > p { margin-top: 10px; color: var(--muted); font-size: 14px; }
.training-card > .primary { margin-top: 24px; }
.training-status { font-size: 12px !important; font-variant-numeric: tabular-nums; }
.training-status:empty { display: none; }
.progress-track { height: 5px; background: var(--soft); border-radius: 4px; margin-top: 16px; overflow: hidden; }
.progress-track > div { width: 0; height: 100%; background: var(--accent); transition: width .2s ease-out; }
.metrics { display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid var(--border); padding-top: 20px; margin-top: 20px; }
.metrics strong { display: block; font-size: 28px; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.metrics span { font-size: 12px; color: var(--muted); }
.preview-card { padding: 24px; }
.preview-top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; }
.preview-top h3 { font-size: 14px; letter-spacing: 0; }
.preview-pill { font-size: 12px; color: var(--muted); }
.prediction-main { padding: 28px 0 24px; }
.prediction-main h3 { font-size: 27px; letter-spacing: -.03em; overflow-wrap: anywhere; }
.prediction-main p { color: var(--muted); font-size: 14px; margin-top: 8px; }
.prediction-row { display: grid; grid-template-columns: minmax(80px, 1fr) minmax(50px, 1.3fr) 36px; gap: 10px; align-items: center; font-size: 13px; margin-bottom: 14px; }
.prediction-name { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar { height: 7px; background: var(--soft); border-radius: 3px; overflow: hidden; }
.fill { width: 0; height: 100%; background: var(--class-color); border-radius: 3px; transition: width .15s ease-out; }
.score { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.threshold-label { display: flex; justify-content: space-between; margin-top: 26px; font-size: 13px; color: var(--muted); }
.threshold-label strong { font-weight: 600; color: #293d6b; }
input[type=range] { width: 100%; accent-color: var(--accent); margin: 6px 0; min-height: 32px; }
.subtle { color: var(--muted); font-size: 12px; }
.export-section { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--border); }
.export-section p { color: var(--muted); font-size: 12px; margin-top: 12px; line-height: 1.65; }
footer { display: flex; gap: 8px; align-items: center; border-top: 1px solid var(--border); margin-top: 40px; padding: 20px 0; }
footer p { flex: 1; color: var(--muted); font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 20; max-width: min(90vw, 650px); background: var(--monitor); color: white; border-radius: 10px; padding: 14px 20px; font-size: 14px; box-shadow: 0 8px 24px rgb(16 30 55 / .16); }
dialog { width: min(700px, calc(100% - 32px)); max-height: 85dvh; border: 0; border-radius: 16px; padding: 28px; background: var(--surface); color: inherit; box-shadow: 0 20px 80px rgb(16 30 55 / .2); }
dialog::backdrop { background: #14223b80; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; }
.icon-button { width: 44px; height: 44px; flex-shrink: 0; border: 0; border-radius: 8px; background: var(--soft); color: var(--muted); font-size: 26px; }
dialog p, dialog li { font-size: 16px; color: var(--muted); line-height: 1.65; margin-bottom: 12px; }
dialog h3 { margin: 22px 0 8px; font-size: 18px; }
dialog code { font-family: ui-monospace, monospace; font-size: 13px; }
dialog pre { white-space: pre-wrap; overflow-wrap: anywhere; padding: 16px; background: var(--soft); border-radius: 8px; max-height: 300px; overflow: auto; }
.field { margin: 16px 0; }
.field label { display: block; font-size: 16px; margin-bottom: 7px; font-weight: 600; }
dialog select, dialog input:not([type=range]) { width: 100%; min-height: 46px; padding: 10px 12px; background: var(--surface); color: inherit; border: 1px solid #aab5ca; border-radius: 8px; }
.dialog-buttons { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.dialog-notice { padding: 14px 16px; background: var(--soft); border-radius: 8px; font-size: 14px; }
.small { font-size: 13px; }
.sample-review { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.sample-review > div { border: 1px solid var(--border); border-radius: 8px; padding: 8px; }
.sample-review svg { width: 100%; height: 42px; }
.sample-review button { font-size: 14px; padding: 6px; color: #a02d42; }
.confusion { border-collapse: collapse; width: 100%; font-size: 14px; font-variant-numeric: tabular-nums; }
.confusion td, .confusion th { padding: 9px; text-align: center; border: 1px solid var(--border); }
.confusion th { background: var(--soft); }
.confusion .correct { background: #e8f4ed; color: #185b45; }
.source-sample-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 12px; color: var(--monitor-text); font-size: 13px; }
.source-sample-controls select { padding: 6px 9px; background: #243754; color: #fff; border: 1px solid #506080; border-radius: 6px; min-height: 36px; }
@media (max-width: 1100px) {
  main { padding: 36px 24px 0; }
  .topbar { padding: 16px 24px; }
  .workspace { gap: 28px 24px; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
  .examples-column { grid-column: 1; grid-row: 1 / span 2; }
  .training-column { grid-column: 2; grid-row: 1; }
  .preview-column { grid-column: 2; grid-row: 2; }
  .column-heading { min-height: 0; }
  .step-count { flex-basis: 100%; }
  .signal-display { padding-left: 24px; }
  .source-body { gap: 24px; }
}
@media (max-width: 700px) {
  .topbar { padding: 14px 16px; flex-wrap: wrap; gap: 12px; }
  .brand { font-size: 21px; }
  .brand-icon { width: 32px; height: 32px; border-radius: 9px; }
  .app-kind { display: none; }
  .topbar nav { gap: 4px; margin-left: auto; }
  .topbar .text-button { padding: 10px; font-size: 13px; }
  #save-project { padding-inline: 12px; }
  main { padding: 32px 16px 0; }
  h1 { font-size: 36px; }
  .intro { text-align: left; margin-bottom: 28px; }
  .subtitle { font-size: 15px; max-width: 38ch; }
  .project-row { gap: 8px 14px; }
  .project-row input { width: 100%; }
  .local-badge { margin-left: 0; }
  .source-panel { padding: 22px; }
  .source-head { align-items: flex-start; flex-wrap: wrap; gap: 18px; }
  .source-actions { width: 100%; justify-content: space-between; flex-direction: row-reverse; }
  .source-body { grid-template-columns: 1fr; gap: 18px; margin-top: 20px; }
  .signal-display { border-left: 0; border-top: 1px solid #35435c; padding: 16px 0 0; }
  .signal-display canvas { height: 88px; }
  .signal-legend { justify-content: flex-start; }
  .workspace { display: flex; flex-direction: column; gap: 32px; margin-top: 32px; }
  .workspace > div { width: 100%; }
  .column-heading { gap: 9px; justify-content: space-between; }
  .column-heading h2 { font-size: 21px; }
  .step-count { flex-basis: auto; }
  .gesture-card, .training-card, .preview-card { padding: 22px; }
  .gesture-top { gap: 8px; }
  .gesture-name input { font-size: 20px; }
  footer { flex-wrap: wrap; margin-top: 32px; }
  footer p { flex: 0 0 100%; margin-bottom: 6px; }
  footer .text-button { padding-left: 0; padding-right: 20px; }
  .sample-review { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
