:root {
  color-scheme: light;
  --bg: #f6fbff;
  --surface: #ffffff;
  --surface-soft: #edf6ff;
  --text: #172033;
  --muted: #607086;
  --border: #d9e6f2;
  --accent: #1677ff;
  --accent-dark: #0c5dcc;
  --ok: #10805c;
  --ok-bg: #e9f8f1;
  --warn: #9a5d00;
  --warn-bg: #fff6da;
  --err: #c73939;
  --err-bg: #fff0f0;
  --shadow: 0 10px 30px rgba(35, 68, 105, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  background:
    radial-gradient(circle at top left, rgba(22, 119, 255, 0.10), transparent 32rem),
    linear-gradient(180deg, #f6fbff 0%, #eef7ff 100%);
}

button,
input,
textarea {
  font: inherit;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  padding: 0 16px;
  color: #fff;
  background: var(--accent);
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(22, 119, 255, 0.18);
}

button:active {
  transform: translateY(1px);
}

button:disabled {
  color: #91a0b2;
  background: #e3ebf4;
  box-shadow: none;
}

button.secondary,
button.ghost {
  color: var(--accent-dark);
  background: var(--surface-soft);
  box-shadow: none;
}

button.ghost {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border);
  background: #fff;
}

button.danger {
  color: var(--err);
  background: var(--err-bg);
}

label {
  display: grid;
  gap: 7px;
  margin-top: 14px;
  color: #34455a;
  font-size: 13px;
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 13px;
  color: var(--text);
  background: #fbfdff;
  outline: none;
}

input {
  min-height: 44px;
}

textarea {
  min-height: 160px;
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: rgba(22, 119, 255, 0.6);
  box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.11);
}

.mobile-shell {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 16px;
  padding-bottom: max(24px, env(safe-area-inset-bottom));
}

.hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 2px 8px;
}

.hero h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: 0;
}

.hero p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.card {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid rgba(217, 230, 242, 0.9);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.card h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: 0;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.status-pill {
  flex: 0 0 auto;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 700;
}

.status-pill.ok {
  color: var(--ok);
  background: var(--ok-bg);
}

.status-pill.err {
  color: var(--err);
  background: var(--err-bg);
}

.notice {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 700;
}

.notice.warning {
  color: var(--warn);
  background: var(--warn-bg);
  border: 1px solid #f0d990;
}

.stack {
  display: grid;
  gap: 10px;
}

.button-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.primary-wide {
  width: 100%;
  margin-top: 14px;
}

.inbox-list {
  display: grid;
  gap: 10px;
  min-height: 42px;
}

.inbox-empty {
  padding: 14px;
  border-radius: 12px;
  color: var(--muted);
  background: #f7fbff;
  border: 1px dashed var(--border);
}

.inbox-item {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fbfdff;
}

.inbox-item input[type="checkbox"] {
  width: 24px;
  min-height: 24px;
  margin: 2px 0 0;
}

.inbox-title {
  font-weight: 800;
  overflow-wrap: anywhere;
}

.inbox-url,
.inbox-note {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.delete-one {
  min-width: 44px;
  min-height: 36px;
  padding: 0 10px;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.summary-item,
.checklist-row {
  border-radius: 12px;
  padding: 10px;
  border: 1px solid var(--border);
  background: #f8fbff;
}

.summary-item strong {
  display: block;
  font-size: 18px;
  line-height: 1.1;
}

.summary-item span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.summary-item.ok,
.checklist-row.ok {
  color: var(--ok);
  background: var(--ok-bg);
  border-color: #bde8d3;
}

.summary-item.warning,
.checklist-row.warning {
  color: var(--warn);
  background: var(--warn-bg);
  border-color: #f0d990;
}

.summary-item.error,
.checklist-row.error {
  color: var(--err);
  background: var(--err-bg);
  border-color: #f3c6c6;
}

.checklist-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.checklist-row {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.checklist-detail {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 500;
  overflow-wrap: anywhere;
}

.result-card pre {
  min-height: 80px;
  max-height: 260px;
  overflow: auto;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: #26364a;
  font-size: 12px;
}

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

.action-hint {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.5;
}

.action-hint.ok-hint {
  color: var(--ok);
}

.action-hint.err-hint {
  color: var(--err);
}

.frontmatter-insert {
  width: 100%;
  margin-top: 10px;
}

.format-example {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-soft);
}

.format-example summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--accent-dark);
}

.format-example-pre {
  margin: 10px 0 0;
  padding: 10px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  border-radius: 10px;
  background: #fff;
  color: #26364a;
  font-size: 12px;
  line-height: 1.5;
}

.format-example-note {
  margin: 8px 0 0;
  font-size: 13px;
}

@media (max-width: 480px) {
  .mobile-shell {
    padding: 14px;
  }

  .hero h1 {
    font-size: 25px;
  }

  .card {
    border-radius: 16px;
    padding: 14px;
  }

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

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