:root {
  --paper: #f6f2ea;
  --card: #fffdf8;
  --ink: #1f2a24;
  --ink-2: #4a554e;
  --muted: #858b84;
  --line: #e4ddd0;
  --line-2: #d6cdbd;
  --accent: #a8442a;
  --accent-ink: #fff;
  --gold: #c99a3b;
  --green: #2f6b4f;
  --green-bg: #e6efe8;
  --warn-bg: #fbeee8;
  --tel: #2f6b4f;
  --reserve: #a8442a;
  --map: #c99a3b;
  --radius: 14px;
  --shadow: 0 1px 0 rgba(31, 42, 36, .04), 0 8px 24px -14px rgba(31, 42, 36, .28);
  --font: "Zen Kaku Gothic New", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", system-ui, sans-serif;
  --serif: "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font); font-size: 15px; line-height: 1.7;
  word-break: auto-phrase; text-wrap: pretty;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }

/* ---------- layout ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: 12px max(16px, env(safe-area-inset-left)) 12px max(16px, env(safe-area-inset-right));
  background: var(--ink); color: #f3ede1;
}
.brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; min-width: 0; }
.brand b { font-family: var(--serif); font-size: 18px; letter-spacing: .08em; color: #f3d48a; white-space: nowrap; }
.brand span { font-size: 12px; letter-spacing: .12em; opacity: .75; white-space: nowrap; }
.topbar .spacer { flex: 1; }
.topbar .who { font-size: 12px; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 30vw; }
@media (max-width: 600px) { .topbar .who { display: none; } }
@media (max-width: 420px) { .brand span { display: none; } }
.topbar button { background: transparent; border: 1px solid rgba(243, 237, 225, .35); color: #f3ede1; border-radius: 999px; padding: 4px 12px; font-size: 12px; cursor: pointer; white-space: nowrap; }
.topbar button:hover { background: rgba(243, 237, 225, .12); }

main { max-width: 1120px; margin: 0 auto; padding: 24px 16px 80px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 4px 0 18px; }
.page-head h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(22px, 4.8vw, 28px); letter-spacing: .06em; margin: 0; line-height: 1.35; }
.page-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.crumb { font-size: 13px; color: var(--muted); text-decoration: none; display: inline-flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.crumb:hover { color: var(--ink); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px; }
.section-title { font-size: 13px; letter-spacing: .14em; color: var(--muted); margin: 28px 0 10px; font-weight: 500; }

/* ---------- buttons & fields ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--card); padding: 9px 16px; cursor: pointer; text-decoration: none; font-weight: 500; line-height: 1.3; white-space: nowrap; }
.btn:hover { border-color: var(--ink-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #f3ede1; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); padding: 6px 10px; }
.btn.ghost:hover { background: rgba(31, 42, 36, .06); }
.btn.danger { color: var(--accent); }
.btn.small { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: default; }

label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 5px; font-weight: 500; }
input[type=text], input[type=email], input[type=password], input[type=date], select, textarea {
  width: 100%; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; padding: 10px 12px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(47, 107, 79, .15); }
textarea { min-height: 220px; resize: vertical; line-height: 1.8; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1 1 200px; }

.seg { display: inline-flex; background: #efe8db; border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 14px; border-radius: 8px; cursor: pointer; font-size: 14px; color: var(--ink-2); white-space: nowrap; }
.seg button[aria-pressed=true] { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); font-weight: 500; }

.pill { display: inline-block; font-size: 11px; letter-spacing: .06em; padding: 2px 8px; border-radius: 999px; background: #efe8db; color: var(--ink-2); white-space: nowrap; }
.pill.news { background: var(--green-bg); color: var(--green); }
.pill.column { background: #f6ead2; color: #8a6420; }
.pill.draft { background: #ece9e4; color: var(--muted); }
.pill.open { background: var(--warn-bg); color: var(--accent); }
.pill.done { background: var(--green-bg); color: var(--green); }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background:
  radial-gradient(1200px 500px at 50% -10%, rgba(201, 154, 59, .18), transparent 60%), var(--paper); }
.login { width: min(400px, 100%); padding: 32px 26px 26px; }
.login h1 { font-family: var(--serif); font-weight: 600; text-align: center; font-size: 22px; letter-spacing: .1em; margin: 0 0 4px; }
.login .sub { text-align: center; color: var(--muted); font-size: 13px; margin: 0 0 24px; letter-spacing: .08em; }
.login .btn { width: 100%; padding: 12px; margin-top: 6px; }
.form-error { color: var(--accent); font-size: 13px; margin: 0 0 10px; }

/* ---------- dashboard ---------- */
.store-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
@media (max-width: 380px) { .store-grid { grid-template-columns: 1fr; } }
.store-card { display: flex; flex-direction: column; text-decoration: none; transition: transform .15s ease, box-shadow .15s ease; overflow: hidden; }
.store-card:hover { transform: translateY(-2px); box-shadow: 0 1px 0 rgba(31, 42, 36, .04), 0 14px 30px -16px rgba(31, 42, 36, .35); }
.store-card .head { padding: 16px 18px 12px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.store-card .name { font-family: var(--serif); font-weight: 600; font-size: 18px; letter-spacing: .04em; line-height: 1.4; }
.store-card .domain { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.store-card .body { padding: 14px 18px 16px; display: grid; gap: 12px; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.kpi { text-align: left; }
.kpi .v { font-size: 22px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi .l { font-size: 11px; color: var(--muted); letter-spacing: .04em; white-space: nowrap; }
.kpi .d { font-size: 11px; white-space: nowrap; }
.up { color: var(--green); } .down { color: var(--accent); } .flat { color: var(--muted); }
.store-card .meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); }
.spark { height: 34px; width: 100%; }

/* ---------- store page ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line-2); margin: 0 0 20px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; font-weight: 500; }
.tabs a[aria-current=page] { color: var(--ink); border-color: var(--accent); }
.tabs a .badge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; line-height: 18px; text-align: center; margin-left: 4px; }

.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.tile { padding: 14px 16px; }
.tile .l { font-size: 12px; color: var(--muted); letter-spacing: .06em; }
.tile .v { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.tile .d { font-size: 12px; }
.tile i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }

.chart-card { padding: 16px 16px 8px; margin-top: 16px; }
.chart-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.chart-head h3 { margin: 0; font-size: 15px; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.chart { width: 100%; display: block; }
.chart text { font-size: 11px; fill: var(--muted); font-family: var(--font); }
.chart-tip { position: fixed; pointer-events: none; background: var(--ink); color: #f3ede1; font-size: 12px; padding: 6px 10px; border-radius: 8px; z-index: 50; white-space: nowrap; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
@media (max-width: 760px) { .two-col { grid-template-columns: 1fr; } }
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.bars li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; font-size: 13px; }
.bars .bar { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: #efe8db; overflow: hidden; }
.bars .bar span { display: block; height: 100%; background: var(--green); border-radius: 3px; }
.bars .lab { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { color: var(--muted); font-size: 14px; text-align: center; padding: 28px 12px; }

/* ---------- posts ---------- */
.list { display: grid; gap: 10px; }
.post-row { display: grid; grid-template-columns: 88px 1fr auto; gap: 14px; align-items: center; padding: 10px; text-decoration: none; }
.post-row:hover { border-color: var(--line-2); }
.thumb { width: 88px; aspect-ratio: 4 / 3; border-radius: 10px; object-fit: cover; background: #efe8db; }
.thumb.none { display: grid; place-items: center; color: var(--muted); font-size: 11px; }
.post-row .t { font-weight: 500; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-row .m { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 2px; }
@media (max-width: 520px) { .post-row { grid-template-columns: 72px 1fr; } .post-row .thumb { width: 72px; } .post-row .go { display: none; } }

.editor { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
@media (max-width: 860px) { .editor { grid-template-columns: 1fr; } }
.side-box { padding: 16px; display: grid; gap: 4px; position: sticky; top: 76px; }
@media (max-width: 860px) { .side-box { position: static; } }
.dropzone { border: 1.5px dashed var(--line-2); border-radius: 12px; padding: 16px; text-align: center; color: var(--muted); font-size: 13px; cursor: pointer; background: #fffaf0; }
.dropzone.drag { border-color: var(--green); background: var(--green-bg); }
.dropzone img { border-radius: 8px; margin: 0 auto 8px; max-height: 220px; object-fit: contain; }
.title-input { font-size: 18px !important; font-weight: 500; }
.actions-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 4px; }
.actions-bar .spacer { flex: 1; }

/* ---------- menu editor ---------- */
.menu-tools { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.group { margin-bottom: 14px; }
.group-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); align-items: center; }
.group-head input { font-weight: 700; }
.group-head .ctrl { display: flex; gap: 2px; }
.group-note { padding: 8px 14px 0; }
.group-note input { font-size: 13px; }
.items { padding: 6px 8px 10px; }
.item { display: grid; grid-template-columns: 28px minmax(0, 1.6fr) minmax(90px, .55fr) minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 6px; border-radius: 10px; }
.item:hover { background: #faf5ea; }
.item input { padding: 8px 10px; }
.item .num { color: var(--muted); font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; }
.item .ctrl { display: flex; gap: 0; }
.item-desc { grid-column: 2 / -1; }
.item-desc input { font-size: 13px; }
.price-wrap { position: relative; }
.price-wrap input { padding-right: 26px; text-align: right; font-variant-numeric: tabular-nums; }
.price-wrap::after { content: "円"; position: absolute; right: 9px; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--muted); }
.icon-btn { width: 30px; height: 30px; border: 0; background: transparent; border-radius: 8px; cursor: pointer; color: var(--ink-2); display: grid; place-items: center; font-size: 15px; }
.icon-btn:hover { background: rgba(31, 42, 36, .07); color: var(--ink); }
.icon-btn.del:hover { color: var(--accent); }
.cols-head { display: grid; grid-template-columns: 28px minmax(0, 1.6fr) minmax(90px, .55fr) minmax(0, 1fr) auto; gap: 8px; padding: 6px 14px 0; font-size: 11px; color: var(--muted); letter-spacing: .06em; }
.cols-head span:last-child { width: 96px; }
@media (max-width: 640px) {
  .cols-head { display: none; }
  .item { grid-template-columns: minmax(0, 1fr) 110px; background: #fbf7ee; margin-bottom: 8px; }
  .item .num { display: none; }
  .item .name-in { grid-column: 1 / -1; }
  .item .note-in { grid-column: 1 / 2; grid-row: 2; }
  .item .price-wrap { grid-column: 2 / 3; grid-row: 2; }
  .item .ctrl { grid-column: 1 / -1; justify-content: flex-end; }
  .item-desc { grid-column: 1 / -1; }
}
.savebar { position: sticky; bottom: 0; z-index: 15; margin-top: 18px; padding: 12px 14px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  background: rgba(255, 253, 248, .96); backdrop-filter: blur(6px); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 -10px 30px -20px rgba(0, 0, 0, .35); }
.savebar .msg { flex: 1; font-size: 13px; color: var(--ink-2); min-width: 160px; }
.savebar .msg.dirty { color: var(--accent); font-weight: 500; }

/* ---------- requests ---------- */
.req { padding: 14px 16px; }
.req .m { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.req .b { white-space: pre-wrap; }
.req .reply { margin-top: 10px; padding: 10px 12px; background: var(--green-bg); border-radius: 10px; font-size: 14px; white-space: pre-wrap; }

/* ---------- toast & misc ---------- */
#toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%) translateY(20px); opacity: 0; transition: .2s ease; background: var(--ink); color: #f3ede1; padding: 10px 18px; border-radius: 999px; font-size: 14px; z-index: 60; pointer-events: none; max-width: calc(100% - 32px); text-align: center; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err { background: var(--accent); }
.loading { text-align: center; color: var(--muted); padding: 60px 0; }
.note-box { background: #fbf4e4; border: 1px solid #ecd9b0; border-radius: 12px; padding: 12px 14px; font-size: 13px; color: #6d5523; margin-bottom: 16px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: 12px; color: var(--muted); font-weight: 500; }
.copy-box { display: flex; gap: 8px; margin-top: 10px; }
.copy-box input { font-size: 12px; }
