:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #20242a;
  --muted: #69717d;
  --line: #d9dee6;
  --accent: #0f766e;
  --accent-strong: #0b5f59;
  --danger: #b42318;
  --warning: #8a5a00;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 14px;
  background: var(--surface);
  cursor: pointer;
}

button:hover {
  border-color: var(--accent);
}

button:disabled {
  opacity: 0.55;
  cursor: progress;
}

.shell {
  width: min(1120px, calc(100vw - 32px));
  margin: 24px auto;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
}

h2 {
  font-size: 16px;
  margin-bottom: 10px;
}

.muted {
  color: var(--muted);
}

.statusline {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  background: var(--surface);
}

.badge.dirty {
  color: var(--warning);
  border-color: #d5a11e;
}

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
}

.tab {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.tab.active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.panel {
  display: none;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 0;
}

.panel.active {
  display: block;
}

.toolbar,
.actions,
.sectionHeader {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
}

.actions {
  margin-top: 16px;
}

.assistBox {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafb;
}

.assistBox p {
  flex-basis: 100%;
  font-size: 14px;
}

.access {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
}

.access p {
  margin-top: 4px;
  color: var(--muted);
}

.access label {
  min-width: min(360px, 100%);
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
}

.stack {
  margin-top: 14px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  color: var(--text);
  background: #fff;
}

textarea {
  resize: vertical;
  line-height: 1.55;
}

.split {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(360px, 1.2fr);
  gap: 18px;
}

pre {
  min-height: 220px;
  margin: 0;
  padding: 12px;
  white-space: pre-wrap;
  background: #f3f5f7;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.item {
  display: grid;
  grid-template-columns: 1fr 1fr 1.3fr 96px 96px 96px 40px;
  gap: 8px;
  align-items: end;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.itemMeta {
  grid-column: 1 / -1;
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 13px;
}

.iconButton {
  width: 40px;
  padding: 0;
}

.total {
  margin-top: 12px;
  text-align: right;
}

.message {
  margin: 12px 0;
  padding: 12px;
  border-radius: 6px;
  border: 1px solid;
  background: var(--surface);
}

.error {
  color: var(--danger);
  border-color: #f2b8b5;
}

.warning {
  color: var(--warning);
  border-color: #f2d68a;
}

.hidden {
  display: none !important;
}

.notice {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f3f5f7;
  margin-bottom: 14px;
}

.summary {
  display: grid;
  gap: 8px;
  margin: 0 0 16px;
}

.summary div {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
}

dt {
  color: var(--muted);
}

dd {
  margin: 0;
}

.confirmItems {
  display: grid;
  gap: 8px;
}

.confirmItem {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
}

.doneMark {
  display: inline-block;
  margin-bottom: 14px;
  padding: 6px 12px;
  border-radius: 999px;
  color: #fff;
  background: var(--accent);
}

@media (max-width: 820px) {
  .shell {
    width: min(100vw - 20px, 760px);
    margin: 10px auto;
  }

  .topbar,
  .split {
    display: block;
  }

  .statusline {
    margin-top: 10px;
  }

  .item {
    grid-template-columns: 1fr;
  }
}
