:root{color-scheme:light;--bg:#f5f5f7;--surface:#fff;--label:#202024;--secondary:#676770;--line:#e1e1e7;--blue:#0068d7;--fill:#ebebf0;--bar:#fbfbfde8}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--label);font:16px/1.6 -apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;-webkit-font-smoothing:antialiased}a{color:inherit;text-decoration:none}button,input,select{font:inherit}button{cursor:pointer}button,a,summary{touch-action:manipulation}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible{outline:3px solid #007aff80;outline-offset:3px}[hidden]{display:none!important}.global-bar{position:sticky;top:0;z-index:100;height:72px;padding:0 32px;display:flex;align-items:center;gap:28px;background:var(--bar);border-bottom:1px solid var(--line);backdrop-filter:blur(20px)}.global-brand{display:flex;align-items:center;gap:10px;font-size:18px;font-weight:650;letter-spacing:-.4px;flex:none}.global-brand img{width:32px;height:32px;object-fit:contain}.settings-button{display:grid;place-items:center;border:0;background:var(--fill);color:var(--secondary);width:36px;height:36px;min-width:36px;border-radius:50%;position:relative}.settings-button:after,.close:after{content:"";position:absolute;inset:-5px}.settings-button svg{width:20px;height:20px}.home{max-width:1120px;margin:auto;padding:76px 28px 28px}.eyebrow,.section-en{font-size:11px;font-weight:600;letter-spacing:2.3px;color:var(--secondary)}h1{font-size:clamp(36px,5vw,60px);line-height:1.2;letter-spacing:-2px;font-weight:650;margin:15px 0 16px}footer{display:flex;justify-content:space-between;color:var(--secondary);font-size:11px;margin-top:40px;padding:18px 2px;border-top:1px solid var(--line)}#workspace{height:calc(100dvh - 72px)}.tool-frame{border:0;width:100%;height:100%;display:block;background:var(--bg)}dialog{border:1px solid var(--line);border-radius:22px;width:min(560px,calc(100% - 32px));max-height:88dvh;padding:28px;background:var(--bg);color:var(--label);box-shadow:0 24px 80px #0003}dialog::backdrop{background:#0005;backdrop-filter:blur(4px)}.sheet-title{display:flex;align-items:center;justify-content:space-between;gap:18px}.sheet-title h2{font-size:24px;line-height:1.4;margin:4px 0 0;font-weight:650;letter-spacing:-.5px}.section-en{font-size:10px;letter-spacing:1.7px}.close{position:relative;width:32px;height:32px;flex:0 0 32px;border:0;border-radius:50%;background:var(--fill);color:var(--secondary);padding:0;font-size:22px;display:grid;place-items:center;line-height:1}.settings-note{font-size:13px;color:var(--secondary);margin:16px 0 24px}.settings-section{margin:0 0 26px}.settings-section h3{display:flex;justify-content:space-between;gap:16px;font-size:14px;font-weight:600;margin:0 3px 12px}.settings-section h3 span{font-size:11px;color:var(--secondary);font-weight:400}.segments{display:flex;background:var(--fill);padding:4px;border-radius:10px;gap:4px}.segments button{border:0;border-radius:7px;background:transparent;flex:1;color:var(--secondary);min-height:38px;font-size:14px}.segments [aria-pressed=true]{background:var(--surface);color:var(--label);font-weight:600;box-shadow:0 1px 3px #0001}.setting-row{display:flex;justify-content:space-between;align-items:center;gap:16px;background:var(--surface);border-radius:11px;padding:10px 14px;font-size:14px;margin-top:12px}.setting-row select{background:var(--fill);color:var(--label);border:0;border-radius:8px;padding:8px;font-size:14px}.fields{display:grid;gap:8px;background:var(--surface);padding:18px;border-radius:13px}.fields label{font-size:12px;color:var(--secondary)}.fields input{width:100%;border:1px solid transparent;background:var(--bg);color:var(--label);min-height:42px;padding:9px 12px;border-radius:8px;font-size:14px;min-width:0}.key-row{display:flex;gap:5px}.key-row button{border:0;color:var(--blue);background:none;font-size:12px;white-space:nowrap;padding:8px}.fine{font-size:12px;color:var(--secondary);line-height:1.8;margin:10px 2px}.text-action{background:none;border:0;color:var(--blue);padding:8px 2px;min-height:40px;font-size:13px}.status{font-size:12px;line-height:1.8;color:var(--secondary);overflow-wrap:anywhere}details summary{font-size:13px;color:var(--blue);padding:10px 2px;cursor:pointer}details .fields{margin-top:12px}.override-title{font-size:13px;margin:14px 2px 8px}.data-row{display:flex;align-items:center;gap:8px;background:var(--surface);padding:8px 12px;border-bottom:1px solid var(--line)}.data-row:first-of-type{border-radius:11px 11px 0 0}.data-row:last-of-type{border-radius:0 0 11px 11px;border:0}.data-row span{flex:1;font-size:14px}.data-row button{border:0;background:none;color:var(--blue);font-size:12px;min-height:38px;padding:6px}.primary{border:0;border-radius:10px;background:var(--blue);color:#fff;font-size:14px;font-weight:600;min-height:44px;padding:10px 22px}:root[data-theme=dark]{color-scheme:dark;--bg:#111113;--surface:#202023;--label:#f2f2f7;--secondary:#b0b0ba;--line:#38383f;--blue:#409cff;--fill:#303036;--bar:#1c1c1eed}.red-large-type{font-size:18px}@media(max-width:760px){.global-bar{height:64px;padding:0 18px;gap:14px}.global-brand{font-size:17px}.global-brand img{width:28px;height:28px}.home{padding:45px 22px 20px}h1{font-size:36px;letter-spacing:-1px}footer{margin-top:26px;font-size:10px;gap:16px}#workspace{height:calc(100dvh - 64px)}dialog{margin:auto auto 0;width:100%;max-width:100%;max-height:90dvh;border-radius:22px 22px 0 0;padding:25px 20px max(24px,env(safe-area-inset-bottom))}.fields input{font-size:16px}.settings-section h3{font-size:15px}}@media(prefers-reduced-motion:reduce){*{transition:none!important}}@media(prefers-contrast:more){:root{--secondary:#42424a;--line:#777}:root[data-theme=dark]{--secondary:#ddd;--line:#aaa}}
.select-picker{border:0;border-radius:8px;min-height:40px;padding:8px 12px;background:var(--fill);color:var(--label);font-size:14px}.portal-menu{position:fixed;z-index:1000;background:var(--surface);color:var(--label);border:1px solid var(--line);border-radius:12px;padding:5px;min-width:160px;box-shadow:0 8px 30px #0002}.portal-menu button{display:block;width:100%;text-align:left;border:0;background:none;color:var(--label);font-size:14px;border-radius:8px;min-height:40px;padding:9px 12px}.portal-menu [aria-selected=true],.portal-menu button:hover{background:var(--fill);color:var(--blue)}@media(max-width:760px){.select-picker,.portal-menu button{font-size:16px}}.merged-tool{display:flex;align-items:center;gap:22px;flex:1;min-width:0}.merged-tool button,.merged-tool summary{font:inherit;font-size:14px;border:0;background:none;color:var(--secondary);padding:9px 12px;min-height:40px;border-radius:8px;cursor:pointer;white-space:nowrap}.merged-tool .component-name{font-size:17px;font-weight:600;color:var(--label);padding-left:0}.component-controls{margin-left:auto;display:flex;align-items:center;gap:6px}.component-controls button:hover{background:var(--fill);color:var(--blue)}.component-segments{background:var(--fill);padding:3px;border-radius:9px}.component-segments button{min-height:32px;padding:5px 18px;font-size:13px}.component-segments [aria-pressed=true]{background:var(--surface);color:var(--label);box-shadow:0 1px 3px #0001}@media(max-width:760px){.global-bar{gap:12px;padding:0 14px}.global-brand{gap:6px;font-size:15px}.global-brand img{width:25px;height:25px}.merged-tool{gap:8px}.merged-tool .component-name{font-size:13px;padding:5px 0}.component-controls{gap:0}.component-controls button,.component-controls summary{font-size:12px;padding:8px 6px}.component-segments button{padding:5px 9px}.settings-button{width:32px;height:32px;min-width:32px}}@media(max-width:390px){.global-bar{gap:8px}.global-brand img{display:none}.component-name{max-width:82px;overflow:hidden;text-overflow:ellipsis}.component-controls button,.component-controls summary{padding-left:4px;padding-right:4px}}
/* Scrollable sheet body; header and action remain in place. */
#settings[open]{display:flex;flex-direction:column;padding:0;overflow:hidden;max-height:min(88dvh,900px)}#settings .sheet-title{padding:26px 28px 0;flex:none}#settings>.settings-note{padding:0 28px;margin:14px 0 20px;flex:none}#settingsForm{flex:1 1 auto;overflow-y:auto;min-height:0;overscroll-behavior:contain;padding:0 28px 20px}#settings>.sheet-bottom{flex:none;margin:0;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:12px;padding:14px 28px 18px;border-top:1px solid var(--line);background:var(--bg)}#settings>.sheet-bottom .status{margin:0}
@media (max-width:760px) {
  #settings .sheet-title{padding:24px 22px 0}
  #settings>.settings-note{padding:0 22px}
  #settingsForm{padding:0 22px 20px}
  #settings>.sheet-bottom{padding:12px 22px max(16px,env(safe-area-inset-bottom))}
}
@media (prefers-reduced-motion:reduce) { html { scroll-behavior:auto; } }

.drill-toolbar { gap: 3px; }
#closeSettings, .drill-sound-icon { display: grid; place-items: center; }
#closeSettings { padding: 0; }
#closeSettings svg, .drill-sound-icon svg {
  display: block; width: 16px; height: 16px; fill: none;
  stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.drill-sound-icon svg { width: 20px; height: 20px; }
.data-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.data-actions button, .data-import-button {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--label);
  font: inherit;
  cursor: pointer;
}
.data-actions button.primary { background: var(--primary, var(--blue)); color: var(--on-primary, white); }
.data-import-button:has(+ input:focus-visible) { outline: 2px solid var(--theme-ring); outline-offset: 2px; }
.data-import-button:hover { background: var(--fill-hover, var(--fill)); }
.data-import-button:has(+ input:disabled) { opacity: .5; cursor: wait; }
.data-file-input { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; clip-path: inset(50%); }
.restore-preview { margin: 8px 0 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.restore-preview :is(h4,p) { margin: 0 0 8px; }
.restore-preview p { color: var(--secondary); font-size: 13px; }
#restoreGroups { display: grid; gap: 6px; margin-bottom: 12px; }
#restoreGroups label { display: flex; align-items: center; gap: 8px; color: var(--label); font-size: 14px; }
#restoreGroups input { accent-color: var(--accent, var(--blue)); }
#dataStatus:empty { display: none; }
#dataStatus { margin: 8px 0; }

@media (max-width: 760px) {
  .drill-toolbar button { padding-inline: 5px; }
}
