/* 旅のしおりメーカー。文字・ボタン・きっぷ・コース表示は ../style.css をそのまま使い、色だけ差し替える */

/* 手帳と付箋の色：クリーム色の紙、マリーゴールドのオレンジ、緑のしおりひも */
:root[data-site="shiori"] {
  --sky: #f7f1e5;       /* 背景：クラフト紙 */
  --paper: #fffdf8;     /* カード：手帳の紙 */
  --ink: #3b3343;
  --muted: #7a6f80;
  --edge: #e3d6bf;
  --pink: #de6a2f;      /* 主役：マリーゴールド */
  --pink-soft: #ffe8d6;
  --mint: #3a9f88;      /* 行程の点：しおりひもの緑 */
  --mint-soft: #dcf1ea;
  --sun: #e2a92c;
  --sun-soft: #fff1cc;
  --ride: #cbb690;
}
@media (prefers-color-scheme: dark) {
  :root[data-site="shiori"]:not([data-theme="light"]) {
    --sky: #1f1b18; --paper: #2b2622; --ink: #f5efe6; --muted: #b9ad9d; --edge: #4a4037;
    --pink: #ff9a62; --pink-soft: #4a3020; --mint: #5fcfb2; --mint-soft: #1f3b34;
    --sun: #f5c95e; --sun-soft: #44391f; --ride: #6b5c45;
  }
}
:root[data-site="shiori"][data-theme="dark"] {
  --sky: #1f1b18; --paper: #2b2622; --ink: #f5efe6; --muted: #b9ad9d; --edge: #4a4037;
  --pink: #ff9a62; --pink-soft: #4a3020; --mint: #5fcfb2; --mint-soft: #1f3b34;
  --sun: #f5c95e; --sun-soft: #44391f; --ride: #6b5c45;
}
/* 背景に、手帳の方眼 */
:root[data-site="shiori"] body {
  background-image:
    linear-gradient(color-mix(in srgb, var(--edge) 45%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--edge) 45%, transparent) 1px, transparent 1px);
  background-size: 24px 24px;
  background-attachment: fixed;
}
/* しおりの表紙の上に、付箋のような帯 */
.shiori .ticket-top { position: relative; }
.shiori .ticket-top::before {
  content: ""; position: absolute; top: 0; right: clamp(18px, 6vw, 40px); width: 22px; height: 38px;
  background: var(--mint); border-radius: 0 0 4px 4px;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%);
}

/* つくる／見るの切り替え（晴れの日／雨の日の切り替えと同じ形） */
.tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  background: var(--paper); border: 2px solid var(--edge); border-radius: 999px; padding: 5px;
  box-shadow: 0 4px 0 var(--edge);
}
.tabs button {
  cursor: pointer; border: 0; background: none; border-radius: 999px; padding: 10px 12px;
  font-family: var(--font-pop); font-size: 16px; color: var(--muted);
}
.tabs button[aria-pressed="true"] { background: var(--pink); color: var(--paper); }

/* つくる */
.editor { display: grid; gap: 16px; }
.card {
  background: var(--paper); border: 2px solid var(--edge); border-radius: 24px; box-shadow: 0 5px 0 var(--edge);
  padding: 18px clamp(16px, 4vw, 28px) 20px; display: grid; gap: 12px;
}
.card h2 { margin: 0; font-family: var(--font-pop); font-weight: 400; font-size: 19px; color: var(--pink); }
.hint { margin: 0; font-size: 13px; color: var(--muted); }
.f { display: grid; gap: 4px; font-size: 13px; font-weight: 700; color: var(--muted); }
.editor input, .editor select {
  font: inherit; font-size: 16px; font-weight: 500; color: var(--ink); background: var(--sky);
  border: 2px solid var(--edge); border-radius: 12px; padding: 8px 10px; min-width: 0; width: 100%;
}
.editor input:focus, .editor select:focus { outline: none; border-color: var(--pink); background: var(--paper); }
.editor input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--pink); padding: 0; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
fieldset { margin: 0; border: 2px dashed var(--edge); border-radius: 18px; padding: 10px 12px 12px; display: grid; gap: 8px; min-width: 0; }
legend { padding: 0 6px; font-weight: 700; }
.row { display: flex; gap: 6px; align-items: center; }
.item { display: grid; grid-template-columns: 7em 1fr 32px; gap: 6px; }
.item .m { grid-column: 1 / 3; font-size: 14px; }
.cost { display: grid; grid-template-columns: 1fr 7em 32px; gap: 6px; }
.cost select { grid-column: 1 / 3; }
.x {
  cursor: pointer; width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--edge);
  background: var(--paper); color: var(--muted); font-weight: 700; line-height: 1;
}
.item .x { grid-row: 1; grid-column: 3; }
.x:hover { border-color: var(--pink); color: var(--pink); }
.add {
  cursor: pointer; justify-self: start; border: 2px dashed var(--pink); color: var(--pink); background: none;
  border-radius: 999px; padding: 6px 14px; font-weight: 700;
}
.members { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.members input { flex: 1 1 10em; }
.member {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 4px 4px 12px; border-radius: 999px;
  background: var(--pink-soft); color: var(--ink); font-size: 15px;
}
.member button { cursor: pointer; border: 0; background: none; color: var(--muted); font-weight: 700; padding: 0 6px; }
.pack-edit { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px 12px; }
.pack-edit li { display: flex; justify-content: space-between; align-items: center; gap: 4px; }
.pack-edit label { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.pack-edit .x { width: 26px; height: 26px; font-size: 12px; }

/* 見る：きっぷ風のしおり */
.shiori .ticket-route { font-size: 15px; }
.sh-members { margin: 4px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.sh-members span { font-size: 14px; padding: 2px 12px; border-radius: 999px; background: var(--paper); border: 1px solid var(--edge); }
.sh-day, .sh-sec { display: grid; gap: 10px; }
.sh-day + .sh-day, .sh-sec { border-top: 3px dashed var(--edge); padding-top: 16px; }
.sh-day h3, .sh-sec h3 { margin: 0; font-family: var(--font-pop); font-weight: 400; font-size: 18px; color: var(--pink); }
.sh-stay { background: var(--sky); border-radius: 16px; padding: 10px 14px; display: grid; gap: 4px; font-size: 14px; }
.sh-stay p { margin: 0; font-weight: 700; font-size: 16px; }
.sh-stay dl { margin: 0; display: grid; gap: 2px; }
.sh-stay dl div { display: grid; grid-template-columns: 6.5em 1fr; gap: 8px; }
.sh-stay dt { color: var(--muted); }
.sh-stay dd { margin: 0; overflow-wrap: anywhere; }
.sh-stay.empty { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; color: var(--muted); }
.pack { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 4px 12px; }
.pack li { display: flex; gap: 8px; align-items: center; }
.pack .box {
  width: 18px; height: 18px; flex: none; border: 2px solid var(--edge); border-radius: 5px;
  display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--paper);
}
.pack .done .box { background: var(--pink); border-color: var(--pink); }
.pack .done { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.costs, .moves { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.costs li { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px dotted var(--edge); padding-bottom: 2px; }
.costs small { color: var(--muted); font-size: 12px; }
.sum { margin: 0; font-size: 16px; }
.sum b, .moves b { color: var(--pink); }
.moves li { background: var(--mint-soft); border-radius: 12px; padding: 4px 12px; font-weight: 700; }
.sh-foot { margin: 0; text-align: right; font-size: 12px; color: var(--muted); font-family: var(--font-pop); }

.share-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.share-bar .btn.main { margin-left: 0; }
.btn.ghost { background: transparent; }

@media (max-width: 420px) {
  .item { grid-template-columns: 6em 1fr 32px; }
}

/* 印刷：しおりだけを白い紙に */
@media print {
  /* 端末がダークモードでも白い紙で印刷する */
  :root[data-site="shiori"] { --sky: #fff !important; --paper: #fff !important; --ink: #222 !important; --muted: #555 !important; --edge: #bbb !important; --pink: #c85a22 !important; --pink-soft: #fde9da !important; --mint-soft: #e5f5ee !important; }
  :root[data-site="shiori"] body { background: #fff; }
  .top, .tabs, .editor, .share-bar, .note, .about, footer, .no-print { display: none !important; }
  .viewer { display: block !important; }
  .wrap { max-width: none; padding: 0; }
  .shiori { box-shadow: none; border-color: #bbb; }
  .sh-day { break-inside: avoid; }
}

/* AI で下書き */
.ai { border-style: dashed; box-shadow: none; }
.ai textarea {
  font: inherit; font-size: 15px; font-weight: 500; color: var(--ink); background: var(--sky);
  border: 2px solid var(--edge); border-radius: 12px; padding: 8px 10px; width: 100%; resize: vertical;
}
.ai textarea:focus { outline: none; border-color: var(--pink); background: var(--paper); }
.ai .btn.main { margin-left: 0; }
@media print { .ai { display: none !important; } }

/* AI の欄は、ふだんはボタンだけ */
.ai-wrap { display: grid; }
.ai-toggle {
  cursor: pointer; justify-self: start; display: inline-flex; gap: 6px; align-items: center;
  border: 2px dashed var(--edge); background: var(--paper); color: var(--muted);
  border-radius: 999px; padding: 8px 16px; font-size: 14px; font-weight: 700;
}
.ai-toggle b { color: var(--pink); }
.ai-toggle:hover { border-color: var(--pink); }
.ai-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
@media print { .ai-wrap { display: none !important; } }
.ai-lead { margin: 0; font-size: 14px; }
.ai-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; counter-reset: step; }
.ai-steps li { counter-increment: step; display: grid; gap: 6px; padding-left: 40px; position: relative; }
.ai-steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; background: var(--pink); color: var(--paper); font-family: var(--font-pop); font-size: 15px;
}
.ai-steps li:not(:last-child)::after {
  content: ""; position: absolute; left: 13px; top: 32px; bottom: -12px; width: 2px; background: var(--edge);
}
.ai-steps b { font-size: 15px; color: var(--ink); }
.ai-steps .f { color: var(--ink); }
.ai-tips { margin: 0; padding: 10px 14px; list-style: none; display: grid; gap: 4px; background: var(--sky); border-radius: 14px; font-size: 13px; color: var(--muted); }
