:root {
  --bg: #eef5f2;
  --surface: #ffffff;
  --text: #14211d;
  --muted: #66736e;
  --line: #d8e4df;
  --primary: #087f5b;
  --primary-strong: #066649;
  --danger: #c92a2a;
  --soft: #e6f3ee;
  --shadow: 0 12px 32px rgba(9, 54, 39, 0.08);
}

.request-page {
  --bg: #fff6e8;
  --surface: #fffdf8;
  --text: #2a2118;
  --muted: #78685b;
  --line: #f0dfc9;
  --primary: #1ba06d;
  --primary-strong: #0d744f;
  --soft: #e9f8ef;
  --shadow: 0 14px 34px rgba(139, 91, 35, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Yu Gothic UI", "Hiragino Kaku Gothic ProN", sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #f6faf8 0%, var(--bg) 100%);
}

.request-page {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0)),
    linear-gradient(180deg, #fff9ef 0%, #ffeacc 100%);
}

.app-shell {
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 18px 14px 32px;
}

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

.request-hero {
  align-items: flex-end;
  padding: 12px 2px 2px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--primary);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0;
}

.request-page .eyebrow {
  color: #e26b2d;
}

.hero-copy {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 1.6rem;
}

h2 {
  margin-bottom: 0;
  font-size: 1.05rem;
}

.surface,
.notice {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.surface {
  padding: 16px;
}

.request-card {
  border-color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 253, 248, 0.92);
}

.surface + .surface,
.stack > * + * {
  margin-top: 14px;
}

.stack-sm > * + * {
  margin-top: 10px;
}

.notice {
  padding: 12px 14px;
  color: #8a5a00;
  background: #fff9db;
}

.inline-alert {
  margin: 12px 0 0;
  padding: 10px 12px;
  border: 1px solid #ffd8a8;
  border-radius: 8px;
  color: #8a5a00;
  background: #fff4df;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.5;
}

.field {
  display: grid;
  gap: 6px;
}

.profile-card {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff8ed;
}

.field span,
.amount-view span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

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

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

.request-page input,
.request-page select,
.request-page textarea {
  min-height: 48px;
  background: #fffefa;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(8, 127, 91, 0.18);
  border-color: var(--primary);
}

.section-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.button,
.link-button,
.icon-button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
}

.button,
.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 14px;
  font-weight: 700;
}

.button.primary {
  background: var(--primary);
  color: #fff;
}

.request-page .button.primary {
  background: #06c755;
  color: #fff;
}

.request-page .button.primary:hover {
  background: #05ae4b;
}

.button.primary:hover {
  background: var(--primary-strong);
}

.button.ghost,
.link-button {
  background: var(--soft);
  color: var(--primary-strong);
}

.request-page .button.ghost,
.request-page .link-button {
  background: #fff3df;
  color: #9a4d1f;
}

.pill-button {
  min-height: 38px;
  border-radius: 999px;
  padding-inline: 16px;
}

.button.danger {
  background: #fff0f0;
  color: var(--danger);
}

.button-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.entry-card {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf1;
}

.entry-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.25fr auto;
  gap: 10px;
  align-items: end;
}

.added-heading {
  margin-top: 16px;
}

.sub-count {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.item-row,
.rate-row {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfefd;
  padding: 12px;
}

.item-row {
  grid-template-columns: 0.85fr 1.25fr auto 36px;
  align-items: end;
}

.request-page .item-row {
  background: #fffaf1;
}

.added-item {
  grid-template-columns: 1fr auto auto;
  align-items: center;
}

.added-item-main {
  display: grid;
  gap: 4px;
}

.added-date {
  color: var(--primary-strong);
  font-size: 1.05rem;
}

.added-site {
  color: var(--text);
  font-weight: 700;
}

.empty-list {
  margin: 0;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 250, 241, 0.72);
  font-weight: 700;
}

.amount-view {
  display: grid;
  gap: 6px;
  min-width: 86px;
}

.amount-view strong,
.total {
  color: var(--primary-strong);
}

.icon-button {
  width: 36px;
  height: 36px;
  background: #f1f3f2;
  color: var(--muted);
  font-size: 1.2rem;
}

.request-page .icon-button {
  border-radius: 999px;
  background: #fff0e0;
  color: #aa5a24;
}

.output {
  margin-top: 12px;
  min-height: 260px;
  resize: vertical;
  line-height: 1.6;
  white-space: pre-wrap;
}

.request-page .output {
  background: #fbfff8;
  border-color: #cfeede;
}

.message {
  min-height: 22px;
  margin: 10px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.message.success {
  color: var(--primary);
}

.message.error {
  color: var(--danger);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.rates-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.rate-row {
  grid-template-columns: auto 1.4fr 1fr 1fr auto;
  align-items: end;
}

.priority-controls {
  display: grid;
  grid-template-columns: 36px;
  gap: 6px;
}

.priority-controls .icon-button {
  height: 34px;
  font-size: 1rem;
}

.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

.switch-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.row-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  grid-column: 1 / -1;
}

.hidden {
  display: none !important;
}

@media (max-width: 560px) {
  .app-shell {
    padding: 14px 10px 28px;
  }

  .topbar {
    align-items: flex-start;
  }

  .surface {
    padding: 14px;
  }

  .profile-card {
    grid-template-columns: 1fr;
  }

  .entry-grid,
  .item-row {
    grid-template-columns: 1fr 1fr 36px;
  }

  .site-field {
    grid-column: span 2;
  }

  .amount-view {
    grid-column: span 2;
  }

  .button-grid,
  .grid-2,
  .rate-row {
    grid-template-columns: 1fr;
  }

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

  .row-buttons {
    grid-template-columns: 1fr 1fr;
  }

  .priority-controls {
    grid-template-columns: 1fr 1fr;
  }
}
