/* Header notices stay in normal document flow, including their expanded list. */
.topbar {
  display: grid;
  grid-template-columns: 40px minmax(200px, 1fr) auto auto;
  align-items: center;
}
.topbar-brand, .notice-panel, .top-actions, .main, .card, .pane, .pane-body, .row2 > * { min-width: 0; }
.topbar-brand h1 { overflow-wrap: anywhere; }
.top-actions { margin-left: 0; justify-content: flex-end; flex-wrap: nowrap; }
.top-actions .tag { white-space: nowrap; }
.top-actions .btn-mini { min-height: 36px; white-space: nowrap; }
.notice-panel {
  align-self: center;
  justify-self: end;
  width: max-content;
  max-width: min(640px, 44vw);
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--card2);
  overflow: hidden;
}
.notice-panel[hidden] + .top-actions { grid-column: 4; }
.notice-bar { display: flex; align-items: center; min-width: 0; min-height: 40px; gap: 10px; padding-left: 12px; padding-right: 10px; }
.notice-caption { display: inline-flex; align-items: center; gap: 6px; color: var(--accent2); font-size: 11px; white-space: nowrap; }
.notice-dot { width: 5px; height: 5px; background: currentColor; border-radius: 50%; }
.notice-current { flex: 0 1 auto; min-width: 0; display: flex; }
.notice-action { display: inline-flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; min-height: 40px; padding: 8px 0; border: 0; background: transparent; font: inherit; line-height: 1.65; color: var(--text); text-decoration: none; text-align: left; cursor: pointer; }
.notice-preview { font-size: 12px; }
.notice-title { min-width: 0; overflow-wrap: anywhere; white-space: normal; }
.notice-action-symbol { flex-shrink: 0; color: var(--accent2); font-size: 11px; white-space: nowrap; }
.notice-action:hover .notice-title { color: var(--accent2); text-decoration: underline; }
.notice-toggle { flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; gap: 4px; border: 0; border-left: 1px solid var(--border-soft); padding: 0 10px; min-height: 40px; background: transparent; color: var(--muted); cursor: pointer; font: inherit; font-size: 11px; white-space: nowrap; }
.notice-toggle:hover { color: var(--accent2); background: var(--accent-soft); }
.notice-chevron { font-size: 14px; transform: translateY(-2px); }
.notice-toggle[aria-expanded="true"] .notice-chevron { transform: rotate(180deg) translateY(-2px); }
.notice-toggle:focus-visible, .notice-action:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; border-radius: 4px; }
.notice-list { border-top: 1px solid var(--border-soft); padding: 12px; max-height: min(280px, 40vh); overflow-y: auto; overscroll-behavior: contain; }
.notice-list-heading { color: var(--dim); font-size: 11px; margin-bottom: 8px; }
.notice-list ol { list-style: none; display: grid; gap: 8px; }
.notice-list li { display: flex; gap: 8px; padding: 8px 0; font-size: 12px; line-height: 1.65; }
.notice-list li + li { border-top: 1px solid var(--border-soft); }
.notice-list li::before { content: ""; width: 4px; height: 4px; background: var(--accent); border-radius: 50%; flex-shrink: 0; margin-top: 8px; }
.notice-content { font-size: 13px; }
.notice-list li .notice-action { width: 100%; justify-content: space-between; }
.notice-dialog { width: min(560px, calc(100vw - 32px)); max-width: calc(100vw - 32px); max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px); margin: auto; padding: 0; border: 1px solid var(--border); border-radius: 16px; background: var(--card); color: var(--text); box-shadow: 0 24px 90px rgba(0,0,0,.3); }
.notice-dialog[open] { display: flex; flex-direction: column; }
.notice-dialog::backdrop { background: rgba(5,12,18,.58); backdrop-filter: blur(3px); }
.notice-dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 22px 24px 18px; border-bottom: 1px solid var(--border-soft); flex-shrink: 0; }
.notice-dialog-heading > div { min-width: 0; }
.notice-dialog-eyebrow { font-size: 11px; color: var(--accent2); margin-bottom: 8px; }
.notice-dialog h2 { font-size: 19px; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }
.notice-dialog-close { width: 36px; height: 36px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: 8px; background: var(--card2); color: var(--muted); font-size: 24px; cursor: pointer; }
.notice-dialog-close:hover { color: var(--text); background: var(--accent-soft); }
.notice-dialog-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.notice-dialog-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 22px 24px; font-size: 14px; line-height: 1.85; white-space: pre-wrap; overflow-wrap: anywhere; }
.notice-dialog-hint { flex-shrink: 0; border-top: 1px solid var(--border-soft); padding: 12px 24px; color: var(--muted); font-size: 11px; }
.notice-dialog-open, .notice-dialog-open body { overflow: hidden; }

@media (max-width: 1400px) {
  .idle-guide, .steps, .meta-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .top-actions .tag { display: none; }
  .topbar { grid-template-columns: 40px minmax(200px, 1fr) auto auto; }
}
@media (min-width: 901px) and (max-width: 1180px) {
  body { padding: 16px; }
  .card-form { width: 340px; }
  .card { padding: 18px; }
  .main { gap: 14px; }
  .topbar { gap: 10px; }
  .topbar h1 { font-size: 16px; letter-spacing: 0; }
  .topbar p { font-size: 11px; }
  .topbar { grid-template-columns: 40px minmax(180px, 1fr) auto auto; }
}
@media (max-width: 900px) {
  html { height: auto; min-height: 100%; }
  body { min-height: 100vh; min-height: 100dvh; height: auto; overflow-y: auto; padding: 16px; }
  .topbar { grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; }
  .topbar h1 { font-size: 17px; letter-spacing: 0; }
  .top-actions { grid-column: 3; width: auto; }
  .notice-panel[hidden] + .top-actions { grid-column: 3; }
  .notice-panel { grid-column: 1 / -1; grid-row: 2; width: max-content; max-width: 100%; }
  .notice-bar { min-height: 44px; }
  .notice-toggle { min-height: 44px; padding-inline: 14px; }
  .notice-list { max-height: min(300px, 45vh); }
  .notice-list li { font-size: 13px; }
  .notice-preview { font-size: 13px; }
  .notice-action { min-height: 44px; }
  .main { flex: auto; flex-direction: column; gap: 16px; }
  .card { padding: 18px; }
  .card-form { width: 100%; overflow: visible; }
  .card-result { min-height: 440px; }
  .result-split { flex: auto; }
  .pane-output { min-height: 260px; }
  .link-box { max-height: 320px; min-height: 100px; }
  .detail-pre { max-height: 260px; }
  .idle-guide, .steps, .meta-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .step { min-width: 0; padding: 11px; gap: 8px; }
}
@media (max-width: 480px) {
  body { padding: 12px; }
  .topbar { grid-template-columns: 32px minmax(0, 1fr) auto; gap: 9px; }
  .logo { width: 32px; height: 32px; border-radius: 9px; }
  .logo svg { width: 18px; height: 18px; }
  .topbar h1 { font-size: 14px; line-height: 1.45; }
  .topbar p { font-size: 10px; line-height: 1.45; margin-top: 3px; }
  .top-actions { gap: 0; }
  .top-actions .btn-mini { font-size: 11px; min-height: 40px; padding: 6px 8px; }
  .notice-bar { gap: 8px; padding-left: 10px; }
  .notice-toggle { padding-inline: 9px; }
  .notice-dialog { border-radius: 13px; }
  .notice-dialog-heading { padding: 18px; gap: 12px; }
  .notice-dialog h2 { font-size: 17px; }
  .notice-dialog-close { width: 40px; height: 40px; }
  .notice-dialog-body { padding: 18px; }
  .notice-dialog-hint { padding: 12px 18px; }
  .card { padding: 15px; border-radius: 13px; }
  .card-title { gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
  .card-title .sub { font-size: 10px; }
  .pane-head { padding: 10px 12px; }
  .pane-body { padding: 12px; }
  input, select, textarea { font-size: 16px; padding: 10px; }
  textarea { font-size: 16px; height: 120px; }
  .row2 { gap: 9px; }
  .copy-url-row { flex-wrap: wrap; }
  .copy-url-text { flex-basis: 100%; font-size: 10px; }
  .copy-url-row .btn-mini { margin-left: auto; min-height: 34px; }
  .success-banner { flex-wrap: wrap; padding: 12px; gap: 10px; }
  .success-banner > div:nth-child(2) { flex: 1; min-width: 0; }
  .success-banner .amt { width: 100%; border-top: 1px solid var(--border); padding-top: 8px; }
  .success-banner .t, .error-banner .t { font-size: 13px; }
  .success-banner .d { overflow-wrap: anywhere; }
  .btn-row { gap: 8px; }
  .btn-ghost, .btn-open { padding: 11px 6px; font-size: 12px; }
  .meta-item { padding: 8px; }
  .meta-item .v { font-size: 12px; }
  .idle-guide { gap: 8px; }
  .idle-guide .g { padding: 10px; font-size: 11px; }
  .step { font-size: 11px; padding: 9px 7px; gap: 6px; }
  .step .icon { width: 21px; height: 21px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
