:root {
  --paper: #f4efe4;
  --ink: #1d1a16;
  --muted: #5e564c;
  --card: #fffdf8;
  --line: #e4d9c8;
  --accent: #c4472a;
  --accent-ink: #fff8f4;
  --green: #1d6b45;
  --green-soft: #e5f3eb;
  --warn: #8a4b08;
  --warn-soft: #fff1dc;
  --shadow: 0 10px 30px rgba(60, 40, 20, 0.06);
  color-scheme: light;
  font-family: "Hiragino Sans", "Yu Gothic", "Noto Sans JP", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); }
a { color: var(--green); }
button, input, select, textarea { font: inherit; color: inherit; }
h1 { font-size: 1.7rem; line-height: 1.3; margin: 0.2rem 0; }
h2 { font-size: 1.05rem; margin: 0 0 0.8rem; }
p { line-height: 1.6; }

.top {
  display: flex; justify-content: space-between; gap: 1rem; align-items: center;
  padding: 0.8rem 1rem; background: #241c16; color: #f6efe4; position: sticky; top: 0; z-index: 5;
}
.brand { color: inherit; text-decoration: none; font-weight: 700; display: flex; gap: 0.45rem; align-items: center; }
.brand span { background: var(--accent); color: white; width: 1.8rem; height: 1.8rem; display: grid; place-items: center; border-radius: 0.4rem; }
.account { display: flex; gap: 0.8rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.account a, .account button.link { color: #f6efe4; text-decoration: none; background: none; border: 0; padding: 0; cursor: pointer; }
.who { color: #d9cbb8; font-size: 0.85rem; max-width: 14rem; overflow: hidden; text-overflow: ellipsis; }
main { width: min(1100px, calc(100% - 1.5rem)); margin: 1rem auto 3rem; }
main.wide { width: min(1200px, calc(100% - 1.2rem)); }
.banner { background: var(--warn-soft); color: var(--warn); padding: 0.8rem 1rem; border-bottom: 1px solid #f0d7ae; }
.banner a { color: var(--warn); font-weight: 700; }
.flash { background: var(--green-soft); color: var(--green); padding: 0.7rem 1rem; }
.lead { color: var(--muted); }
.crumb { color: var(--muted); font-size: 0.9rem; }

.btn, button.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.3rem;
  background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 999px;
  min-height: 44px; padding: 0.4rem 1rem; text-decoration: none; cursor: pointer; font-weight: 700;
}
.btn.small { min-height: 36px; padding: 0.2rem 0.8rem; font-size: 0.92rem; }
.btn.green { background: var(--green); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.warn { background: transparent; color: var(--accent); border: 1px solid #efc2b6; }
button.link { background: none; border: 0; color: var(--green); cursor: pointer; padding: 0; text-decoration: underline; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0.8rem; }
.tool { background: var(--card); border: 1px solid var(--line); border-radius: 1rem; padding: 1rem; text-decoration: none; color: inherit; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 0.4rem; min-height: 9rem; }
.tool span { color: var(--muted); flex: 1; }
.tool em { font-style: normal; color: var(--green); font-weight: 700; font-size: 0.9rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 1rem; padding: 1rem; margin: 0.8rem 0; box-shadow: var(--shadow); }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.6rem; }
.metric { background: #2a211b; color: #f7f1e7; border-radius: 0.9rem; padding: 0.8rem; }
.metric b { display: block; font-size: 1.25rem; margin-top: 0.2rem; }
.metric span { color: #d9cbb8; font-size: 0.8rem; }
.tabs { display: flex; gap: 0.4rem; overflow: auto; padding-bottom: 0.3rem; }
.tabs a { text-decoration: none; color: var(--ink); background: #efe7d8; border-radius: 999px; padding: 0.45rem 0.8rem; white-space: nowrap; }
.tabs a.on { background: var(--ink); color: white; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.7rem; }
.field { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.92rem; }
.field span { color: var(--muted); }
input, select, textarea { background: white; border: 1px solid var(--line); border-radius: 0.6rem; padding: 0.55rem 0.7rem; min-height: 44px; width: 100%; }
textarea { min-height: 7rem; }
.row-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 0.45rem 0.35rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table-wrap { overflow: auto; }
.empty { color: var(--muted); background: #f7f1e6; border-radius: 0.8rem; padding: 0.8rem; }
.note { color: var(--muted); font-size: 0.9rem; }
.warnbox { background: var(--warn-soft); border-radius: 0.8rem; padding: 0.7rem 0.8rem; color: var(--warn); }
.bar { height: 8px; background: #efe7d8; border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--green); }
.hero { display: grid; gap: 1rem; grid-template-columns: 1.2fr 0.8fr; align-items: center; }
.price { font-size: 1.8rem; font-weight: 800; }
.list { padding-left: 1.1rem; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.3rem; }
.cal a, .cal div { background: white; border: 1px solid var(--line); border-radius: 0.5rem; min-height: 4.2rem; padding: 0.3rem; text-decoration: none; color: inherit; font-size: 0.8rem; }
.cal .muted { background: transparent; border: 0; }
.tag { display: inline-block; background: #efe7d8; border-radius: 99px; padding: 0.1rem 0.45rem; font-size: 0.78rem; }
.tag.bad { background: #fde4dc; color: var(--accent); }
.tag.ok { background: var(--green-soft); color: var(--green); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.chart { display: flex; align-items: flex-end; gap: 4px; height: 120px; }
.chart i { display: block; flex: 1; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 2px; }
@media (max-width: 800px) {
  .hero, .split { grid-template-columns: 1fr; }
  h1 { font-size: 1.4rem; }
  .who { display: none; }
}
@media print {
  .top, .tabs, .btn, form, .banner, .flash { display: none !important; }
  body, main { background: white; width: auto; margin: 0; }
  .card { box-shadow: none; }
}
