:root {
  color-scheme: light;
  --ink: #263342;
  --muted: #5c6a7a;
  --border: #d7dfe8;
  --blue: #2457c6;
  --bg: #eff2f5;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font: 15px/1.5 Inter, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select { font: inherit; }
button { cursor: pointer; color: inherit; }
button:disabled { cursor: not-allowed; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #7195e6; outline-offset: 3px; }
svg.i { width: 18px; height: 18px; display: block; flex: none; }
span[data-i] { display: inline-flex; align-items: center; }
.top { border-bottom: 1px solid var(--border); background: white; }
.nav, main { width: min(1260px, calc(100% - 80px)); margin-inline: auto; }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 88px; }
.brand { display: flex; align-items: center; gap: 13px; }
.brand-mark { width: 39px; height: 39px; flex: none; }
h1 { margin: 0; font-size: 23px; font-weight: 620; letter-spacing: -.055em; }
.header-right { display: flex; align-items: center; gap: 20px; margin-left: auto; }
.privacy { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
.privacy > span { color: var(--blue); }
.privacy strong, .privacy div > span { display: block; }
.privacy strong { color: var(--ink); font-weight: 600; }
.help, .iconbtn { border: 1px solid var(--border); background: white; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; }
.help { border: 0; color: var(--muted); }
.help:hover, .iconbtn:hover, .ghost:hover { background: #eff3f9; }
.intro { padding: 30px 0 23px; }
.intro h2 { font-size: clamp(27px, 2.6vw, 37px); line-height: 1.15; margin: 0 0 9px; letter-spacing: -1.3px; font-weight: 650; }
.intro p, .toolbar p { margin: 0; color: var(--muted); }
.workgrid { display: grid; grid-template-columns: minmax(210px, 250px) minmax(0, 1fr); gap: 20px; align-items: stretch; }
.panel { border: 1px solid var(--border); background: white; border-radius: 12px; }
.source { background: #263342; color: #f2f6fc; border-radius: 12px; position: relative; overflow: clip; padding: 20px; display: flex; flex-direction: column; align-items: flex-start; }
.source-top { display: flex; align-items: center; gap: 9px; width: 100%; margin-bottom: 16px; color: #dbe7f8; }
.source h2, .panel h2 { font-size: 18px; font-weight: 650; letter-spacing: -.4px; line-height: 1.3; margin: 0; }
.folder-name { font-size: 21px; letter-spacing: -.6px; font-weight: 600; line-height: 1.25; margin: 0 0 8px; overflow-wrap: anywhere; }
.source-desc { font-size: 13px; color: #ccd6e3; line-height: 1.55; margin: 0 0 16px; max-width: 380px; }
.source-actions { display: flex; align-items: center; margin-top: auto; }
.btn { display: inline-flex; justify-content: center; gap: 8px; align-items: center; font-weight: 600; border: 1px solid transparent; padding: 10px 14px; border-radius: 7px; line-height: 1.3; font-size: 13px; min-height: 39px; }
.choose { background: var(--blue); color: white; border-color: #5985e3; }
.choose:hover, .primary:hover { background: #1b46a8; }
.primary { color: white; background: var(--blue); }
.primary:disabled { background: #e4eaf3; color: #637083; }
.ghost { border-color: var(--border); background: white; }
.btn:disabled, .iconbtn:disabled { opacity: .7; }
.settings { padding: 22px; display: flex; flex-direction: column; min-width: 0; }
.panel-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 0; }
.panel-heading > span { color: var(--blue); }
.builder-hint { font-size: 12px; color: var(--muted); margin: 0 0 15px; }
.pattern-types { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 0; }
.type-button { display: inline-flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid #cdd8ea; border-radius: 6px; background: #f6f8fd; color: #335eaf; font-size: 12px; font-weight: 600; cursor: grab; }
.type-button:hover { background: #eaf0ff; }
.type-button:disabled { opacity: .45; background: #f5f6f8; cursor: default; }
.type-button .i { width: 15px; height: 15px; }
.plus { font-size: 17px; font-weight: 400; line-height: 1; margin-left: 4px; }
.pattern-track { display: flex; flex-wrap: wrap; align-items: stretch; gap: 9px; padding: 13px; min-height: 0; border: 1px dashed #a5b6d1; border-radius: 8px; background: #f6f8fc; }
.pattern-track.drop-end { box-shadow: inset 0 0 0 2px var(--blue); }
.pattern-block { flex: 1 1 180px; min-width: 170px; max-width: 100%; border: 1px solid #cbd6e5; border-radius: 7px; padding: 9px; background: white; position: relative; }
.pattern-block[data-type="index"] { flex: 0 0 180px; min-width: 170px; border-color: #89a6e2; background: #eff4ff; }
.pattern-block[data-type="separator"] { flex: 0 0 150px; min-width: 140px; }
.pattern-block[data-type="date"] { flex: 0 0 165px; min-width: 150px; }
.pattern-block.dragging { opacity: .4; }
.pattern-block.drop-before { box-shadow: -4px 0 var(--blue); }
.block-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 6px; }
.block-type { display: flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 650; color: #3f5d89; }
.grip { color: #8494ab; cursor: grab; letter-spacing: -3px; padding-right: 5px; }
.block-actions { display: flex; align-items: center; gap: 1px; }
.block-actions button { border: 0; background: transparent; color: #61748e; font-size: 14px; border-radius: 3px; padding: 0 3px; line-height: 21px; }
.block-actions button:hover { background: #e3ebf9; color: var(--blue); }
.block-actions button:disabled { opacity: .25; }
label { display: block; font-size: 11px; font-weight: 600; }
input:not([type=checkbox]), select { width: 100%; height: 35px; border: 1px solid #cbd5e3; border-radius: 5px; padding: 6px 8px; background: #fff; font-size: 12px; font-weight: 450; color: var(--ink); min-width: 0; }
input::placeholder { color: #8190a3; }
label > input:not([type=checkbox]), label > select { display: block; margin-top: 4px; }
.block-input-label { font-size: 10px; color: #65748a; }
.custom-separator { margin-top: 6px; }
.example { background: #173b76; border: 1px solid #173b76; border-left: 4px solid #83b0ff; border-radius: 7px; padding: 13px 15px; display: flex; flex-direction: column; align-items: flex-start; gap: 5px; margin-top: 13px; min-height: 65px; }
.example span { font-size: 10px; color: #c7dbff; font-weight: 600; text-transform: uppercase; letter-spacing: .7px; }
.example code { font: 600 15px/1.5 var(--mono); color: #fff; overflow-wrap: anywhere; max-width: 100%; }
.pair-area { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; margin-top: 15px; }
.toggle-label { display: inline-flex; align-items: center; position: relative; gap: 8px; cursor: pointer; font-size: 12px; }
.toggle-label input { position: absolute; opacity: 0; width: 27px; height: 16px; left: 0; margin: 0; }
.switch { width: 27px; height: 16px; background: #8c99ab; border-radius: 16px; display: inline-block; position: relative; }
.switch:after { content: ""; position: absolute; width: 10px; height: 10px; background: white; border-radius: 12px; left: 3px; top: 3px; transition: transform .12s; }
.toggle-label input:checked + .switch { background: var(--blue); }
.toggle-label input:checked + .switch:after { transform: translateX(11px); }
.toggle-label input:focus-visible + .switch { outline: 3px solid #7195e6; outline-offset: 3px; }
.hint, .date-help { color: var(--muted); font-size: 11px; }
.date-help { margin: 8px 0 0; }
.results { margin-top: 22px; overflow: hidden; }
.tabs { display: flex; align-items: stretch; gap: 24px; padding: 0 24px; border-bottom: 1px solid var(--border); }
.tabs button { display: flex; gap: 7px; align-items: center; position: relative; border: none; background: transparent; font-size: 13px; font-weight: 550; color: var(--muted); padding: 14px 1px; }
.tabs button.active { color: var(--blue); font-weight: 650; }
.tabs button.active:after { content: ""; position: absolute; bottom: -1px; left: 0; right: 0; height: 3px; background: var(--blue); border-radius: 3px; }
.count { border-radius: 5px; background: #eaf0fa; padding: 1px 6px; font-size: 11px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 13px; padding: 21px 24px 16px; }
.toolbar p { font-size: 13px; margin-top: 3px; }
.actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.rename-notice { display: flex; align-items: flex-start; gap: 10px; margin: 0 24px 18px; padding: 11px 13px; border: 1px solid #e7d3a7; border-radius: 6px; background: #fffbf2; color: #786030; font-size: 11px; line-height: 1.6; }
.rename-notice > span { margin-top: 2px; }
.rename-notice strong { color: #60491c; }
.rename-notice div > span { display: block; }
.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; }
th { background: #f5f7fa; color: #627185; white-space: nowrap; font-size: 10px; font-weight: 650; letter-spacing: .7px; text-transform: uppercase; padding: 8px 14px; border-block: 1px solid #e3e8f0; }
th:first-child, td:first-child { padding-left: 24px; }
td { font-size: 12px; padding: 6px 14px; border-bottom: 1px solid #edf0f5; vertical-align: middle; overflow-wrap: anywhere; }
td.name, td.seq, td.output { font-family: var(--mono); }
td.output { color: #2457a6; }
td small { display: block; font: 11px/1.5 Inter, "Segoe UI", Arial, sans-serif; color: #637185; }
td .fallback { color: #906015; }
.seq { color: #6b7b90; }
.tag { display: inline-block; font: 600 9px/1.5 Inter, Arial, sans-serif; letter-spacing: .4px; padding: 1px 5px; border-radius: 3px; background: #eaf0fc; color: #4a679a; margin-left: 6px; }
.empty { min-height: 141px; display: flex; align-items: center; justify-content: center; flex-direction: column; text-align: center; padding: 23px 18px; }
.empty-icon { display: flex; width: 35px; height: 35px; align-items: center; justify-content: center; border-radius: 9px; background: #eff3fa; color: #677f9e; margin-bottom: 7px; }
.empty strong { font-size: 14px; letter-spacing: -.18px; }
.empty p { font-size: 12px; color: var(--muted); margin: 4px 0 0; }
.pages { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 10px 24px; color: var(--muted); font-size: 12px; }
.pages button, #stop { background: white; border: 1px solid var(--border); border-radius: 5px; padding: 4px 8px; font-size: 12px; }
.pages button:disabled { opacity: .4; }
.issue, .notes, .notice { font-size: 13px; border-radius: 7px; padding: 9px 13px; }
.issue, .notes { margin: 0 24px 12px; }
.issue { background: #fff0ed; color: #963e2a; }
.notes, .notice { background: #fff6e4; color: #7b581f; }
.notice { margin: 0 0 15px; }
.activity { background: #edf2fb; padding: 12px 24px; }
.progress-label { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.activity progress { width: 100%; height: 5px; accent-color: var(--blue); }
.logstats { display: grid; grid-template-columns: repeat(auto-fit, minmax(115px, 1fr)); margin: 0 24px 16px; border: 1px solid var(--border); border-radius: 8px; gap: 12px; padding: 12px; }
.logstats small { display: block; color: var(--muted); font-size: 11px; }
.logstats b { font-size: 15px; overflow-wrap: anywhere; }
.result-ok { color: #22704f; }
.result-error, .error-text { color: #ac362d; }
.benefits { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; padding: 0 1px 24px; }
.benefits article { min-width: 0; }
.benefit-icon { border: 1px solid #d5e0f2; background: #e7edf8; color: var(--blue); padding: 10px; border-radius: 10px; flex: none; }
.benefit-icon .i { width: 21px; height: 21px; }
.benefits h2 { margin: 0 0 5px; font-size: 14px; font-weight: 650; letter-spacing: -.2px; }
.benefits p { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.65; }
footer { display: flex; align-items: center; justify-content: center; gap: 7px; color: var(--muted); font-size: 11px; margin: 25px 0; }
.footer-mark svg.i { width: 14px; height: 14px; }
dialog { border: 1px solid var(--border); border-radius: 12px; padding: 24px; max-width: min(500px, 92vw); color: var(--ink); box-shadow: 0 14px 70px #18283c30; }
dialog::backdrop { background: #18283c80; }
.dialog-head, .dialog-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.dialog-head h2 { margin: 0; font-size: 21px; letter-spacing: -.6px; }
#dialog-content { font-size: 14px; color: var(--muted); line-height: 1.55; }
#dialog-content p { margin: 13px 0; }
.dialog-actions { justify-content: flex-end; margin-top: 18px; }
#close { font-size: 22px; }
input:disabled, select:disabled { background: #f2f5fa; color: #7a8799; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
@media (max-width: 1050px) {
  .nav, main { width: calc(100% - 40px); }
  .workgrid { grid-template-columns: 215px minmax(0, 1fr); gap: 15px; }
  .settings, .source { padding: 20px; }
  .toolbar { flex-wrap: wrap; }
  .benefits { gap: 18px; }
}
@media (max-width: 700px) {
  .nav { min-height: 88px; flex-wrap: wrap; gap: 12px; padding-block: 16px; }
  .header-right { gap: 8px; }
  .privacy { font-size: 10px; }
  .brand-mark { width: 30px; height: 30px; }
  h1 { font-size: 21px; }
  .workgrid { grid-template-columns: 1fr; }
  .folder-name, .source-desc { max-width: 100%; }
  .source-actions { margin-top: 0; }
  .benefits { grid-template-columns: 1fr; padding-top: 0; gap: 20px; }
  .toolbar, .tabs { padding-inline: 16px; }
  .actions { flex-wrap: wrap; }
  .rename-notice { margin-inline: 16px; }
  .intro p { font-size: 13px; }
  .pattern-block { flex-basis: 160px; }
}

.index-fields { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 8px; }
.digits-note { display: block; color: #52698d; font-size: 10px; margin-top: 6px; }
.date-method { font-size: 11px; }
td.date-method.fallback { color: #906015; }
.timestamp { white-space: nowrap; font-variant-numeric: tabular-nums; font-size: 11px; }
.seq { white-space: nowrap; }
.log-privacy { display: flex; align-items: center; gap: 7px; margin: 0 24px 15px; color: var(--muted); font-size: 11px; }
.log-privacy .i { width: 14px; height: 14px; }

.help-mode #dialog-title { color: var(--blue); }
.help-mode #dialog-content { color: #161b22; }
.help-steps { list-style: none; padding: 0; margin: 18px 0 30px; }
.help-steps li { margin: 0 0 20px; line-height: 1.65; }
.help-steps li:last-child { margin-bottom: 0; }
.help-number, .help-info-icon { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; font-size: 12px; line-height: 1; color: white; }
.help-number { background: var(--blue); font-weight: 600; }
.help-info-icon { background: #000; font-family: Georgia, serif; font-weight: 700; font-style: normal; }
.help-mode #dialog-content .help-info { margin-top: 30px; }
.help-note-label { color: var(--blue); }

.pattern-header { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; margin-bottom: 12px; }
.benefits details > summary { display: flex; align-items: center; gap: 12px; list-style: none; cursor: pointer; border-radius: 8px; min-height: 44px; }
.benefits details > summary::-webkit-details-marker { display: none; }
.benefits summary h2 { margin: 0; }
.benefit-chevron { width: 8px; height: 8px; flex: none; border: solid var(--blue); border-width: 0 1.7px 1.7px 0; transform: rotate(-45deg); margin: 0 4px 0 0; }
.benefits details[open] .benefit-chevron { transform: rotate(45deg); }
.benefits details p { margin: 8px 4px 0 55px; }
.benefits summary:focus-visible { outline: 3px solid #7195e6; outline-offset: 3px; }
.benefits summary:hover h2 { color: var(--blue); }
#open-idea { display: block; flex: none; width: clamp(128px, 15vw, 167px); min-height: 44px; padding: 0; border: 0; border-radius: 9px; background: transparent; }
#open-idea img { display: block; width: 100%; height: auto; }
#open-idea:hover { filter: brightness(1.07); }
#idea-dialog { width: min(460px, calc(100% - 24px)); max-width: none; max-height: calc(100dvh - 24px); overflow-y: auto; color: var(--ink); background: #fff; border-radius: 16px; padding: clamp(18px, 4vw, 26px); }
#idea-dialog .dialog-head { margin-bottom: 14px; }
#idea-dialog h2 { font-size: clamp(24px, 4vw, 30px); }
#idea-dialog .close { flex: none; width: 36px; height: 36px; border: 0; border-radius: 6px; background: transparent; font-size: 24px; }
#idea-fields { display: grid; gap: 12px; padding: 0; margin: 0; min-width: 0; border: 0; }
#idea-fields label { display: grid; gap: 5px; font-size: 13px; font-weight: 600; }
#idea-fields input, #idea-fields textarea, #idea-fields select { width: 100%; height: auto; min-height: 44px; margin: 0; padding: 10px; color: var(--ink); background: #fff; border: 1px solid var(--border); border-radius: 8px; font: 16px/1.4 Inter, "Segoe UI", Arial, sans-serif; }
#idea-fields textarea { resize: vertical; }
#idea-form .trap { display: none; }
.idea-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.idea-actions button { padding: 10px 14px; border: 1px solid var(--border); border-radius: 7px; background: #fff; font-size: 13px; }
#idea-submit { color: #fff; background: var(--blue); border-color: var(--blue); }
#idea-submit:disabled { opacity: .65; }
#idea-status { margin: 0; font-size: 13px; line-height: 1.5; }
#idea-status:not(:empty) { margin-top: 12px; }
#idea-preview { margin: 14px 0 0; font-size: 13px; line-height: 1.5; }
#idea-preview a { color: var(--blue); }
.mobile-notice { margin: 28px auto; max-width: 620px; padding: 28px 22px; border: 1px solid var(--border); border-radius: 13px; background: #fff; text-align: center; }
.mobile-computer { color: var(--blue); justify-content: center; margin-bottom: 12px; }
.mobile-computer .i { width: 42px; height: 42px; }
.mobile-notice h2 { margin: 0 0 10px; font-size: 25px; line-height: 1.2; letter-spacing: -.6px; }
.mobile-notice > p { color: var(--muted); font-size: 14px; line-height: 1.55; }
.mobile-link { display: flex; gap: 8px; margin-top: 20px; }
.mobile-link input { flex: 1; min-width: 0; height: 42px; background: #f5f7fb; font-size: 12px; }
.copy-status { min-height: 22px; margin-bottom: 0; }
.preview-scroll { overflow: auto; scrollbar-gutter: stable; overscroll-behavior: contain; }
.preview-scroll.limited { max-height: 350px; }
.preview-scroll th { position: sticky; top: 0; z-index: 1; }
.preview-scroll:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
@media (max-width: 850px) {
  .nav { flex-wrap: wrap; gap: 12px; padding-block: 12px; height: auto; }
  #open-idea { margin-left: auto; width: 145px; }
  .header-right { width: 100%; margin: 0; justify-content: space-between; }
  .header-right .privacy { font-size: 11px; }
  .pattern-header { gap: 12px; }
}
@media (max-width: 480px) {
  #open-idea { width: 128px; }
  .mobile-link { flex-direction: column; }
  .mobile-link .btn { width: 100%; min-height: 42px; }
  .brand { gap: 8px; }
  .brand h1 { font-size: 20px; }
  .pattern-block { min-width: min(170px, 100%); }
}
