:root {
    color-scheme: light;
    --background: #f1f5f7;
    --surface: #fff;
    --text: #17282f;
    --muted: #4d606a;
    --line: #d8e3e8;
    --primary: #12574e;
    --primary-hover: #0d423b;
    --danger: #9c3039;
    font-family: "Segoe UI", "Microsoft JhengHei", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--background); color: var(--text); line-height: 1.55; }
.wrap { width: min(920px, calc(100% - 32px)); margin-inline: auto; }
.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.bar { display: flex; min-height: 70px; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; gap: 10px; align-items: center; color: var(--text); text-decoration: none; font-weight: 750; font-size: 18px; }
.mark { flex: none; height: 15px; width: 18px; border: 2px solid var(--primary); border-radius: 3px; position: relative; margin-top: 3px; }
.mark::before { content: ""; position: absolute; width: 7px; left: -2px; bottom: 100%; height: 4px; border: 2px solid var(--primary); border-bottom: 0; border-radius: 3px 3px 0 0; }
main { padding-block: 34px 60px; }
.center { max-width: 620px; padding-top: clamp(36px, 9vw, 105px); }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(26px, 4vw, 36px); line-height: 1.25; letter-spacing: -0.02em; overflow-wrap: anywhere; }
h2 { font-size: 20px; line-height: 1.4; }
h3 { font-size: 16px; overflow-wrap: anywhere; }
.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 3px 10px #15323a08;
    padding: clamp(20px, 4vw, 32px);
    margin-top: 18px;
}
.center .panel { margin-top: 0; }
.compact { max-width: 460px; margin-inline: auto; }
.stack { display: grid; gap: 14px; margin-top: 18px; }
label { display: block; font-size: 14px; font-weight: 650; min-width: 0; }
input, textarea {
    display: block; width: 100%; margin-top: 5px; border: 1px solid #acbec6;
    border-radius: 8px; padding: 9px 11px; background: #fbfdfe; color: var(--text);
    font: inherit; font-weight: 400; min-height: 44px;
}
textarea { resize: vertical; }
[hidden] { display: none !important; }
.file-browser { margin: 0; }
.file-browser .empty, .file-browser code { overflow-wrap: anywhere; }
.dialog-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.download-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.selection-toolbar { padding-top: 12px; border-top: 1px solid var(--line); }
.source-file { display: flex; align-items: center; gap: 10px; min-height: 44px; padding-block: 6px; cursor: pointer; border-top: 1px solid var(--line); }
.source-file:hover, .folder-entry:hover { background: #f5f9fa; }
.source-file input { flex: none; width: 17px; height: 17px; min-height: 0; margin: 0; accent-color: var(--primary); }
.source-file span { flex: 1; overflow-wrap: anywhere; }
.source-file small { flex: none; }
.breadcrumb, .share-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.breadcrumb { margin-block: 12px; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.breadcrumb a { color: var(--primary); }
.folder-entry { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); color: var(--primary); font-weight: 650; overflow-wrap: anywhere; }
.folder-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 4px; border-top: 1px solid var(--line); }
.folder-row .folder-entry { flex: 1; min-width: 0; border-top: 0; }
.time-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.message-copy { flex-wrap: wrap; }
.message-copy label { flex: 1 0 100%; }
button, .quiet {
    display: inline-flex; align-items: center; justify-content: center; white-space: nowrap;
    min-height: 40px; border-radius: 8px; border: 1px solid transparent;
    padding: 7px 14px; font: inherit; font-size: 14px; font-weight: 700; text-decoration: none; cursor: pointer;
}
.primary { background: var(--primary); color: white; }
.primary:hover { background: var(--primary-hover); }
.primary:disabled { opacity: .55; cursor: default; }
.quiet { background: var(--surface); color: var(--primary); border-color: var(--line); }
.quiet:hover { background: #edf5f4; }
.danger { color: var(--danger); }
.danger:hover { background: #fff1f1; }
:focus-visible { outline: 3px solid #347e92; outline-offset: 2px; }
.row { display: flex; align-items: center; gap: 9px; border-top: 1px solid var(--line); padding-block: 14px; }
.row-info { flex: 1; min-width: 0; }
.row:last-child { padding-bottom: 0; }
h2 + .row { margin-top: 14px; }
.note { color: var(--muted); font-size: 14px; }
.intro { margin-block: 8px 16px; }
.empty { padding-top: 12px; }
.status {
    display: inline-block; margin-bottom: 4px; padding: 2px 8px;
    color: #465764; background: #eaf0f2; border-radius: 5px; font-size: 12px; font-weight: 700;
}
.active { background: #dff1e8; color: #17533e; }
.error { background: #fff1f1; color: #882c32; border: 1px solid #e8bdc0; padding: 10px 15px; border-radius: 8px; margin-bottom: 14px; }
.copy-row { display: flex; align-items: end; gap: 8px; margin-block: 9px; }
.copy-row label { flex: 1; }
.copy-row button { min-height: 44px; }
[data-copy-status]:empty { display: none; }
.app-dialog { width: min(540px, calc(100% - 32px)); max-height: calc(100% - 32px); border: 1px solid var(--line); border-radius: 16px; padding: clamp(16px, 4vw, 24px); color: var(--text); }
.app-dialog::backdrop { background: #17282f99; }
.app-dialog .dialog-header { margin-bottom: 12px; }
.wide-dialog { width: min(820px, calc(100% - 32px)); }
.qr-dialog { width: min(460px, calc(100% - 32px)); }
.qr-dialog canvas { display: block; width: min(240px, 100%); height: auto; margin: 12px auto; image-rendering: pixelated; }
.qr-dialog canvas[hidden] { display: none; }
.qr-dialog form { margin-top: 12px; }
@media (max-width: 545px) {
    .time-fields { grid-template-columns: 1fr; }
    .app-dialog .copy-row { flex-wrap: wrap; }
    .app-dialog .copy-row label { flex: 1 0 100%; }
    .dashboard .row { flex-wrap: wrap; }
    .dashboard .row-info { flex: 1 0 100%; }
}
