:root {
  --ink:#39281f;
  --muted:#746b64;
  --paper:#fffdf8;
  --cream:#faf5e9;
  --line:#e9ded0;
  --coral:#ed7465;
  --sage:#4d8068;
  --sky:#dceef6;
  --yellow:#fff0be;
  --shadow:0 8px 24px #503f2914
}
* {
  box-sizing:border-box
}
html {
  scroll-behavior:smooth
}
body {
  margin:0;
  color:var(--ink);
  background:var(--cream);
  font-family:system-ui,-apple-system,"Hiragino Kaku Gothic ProN","Noto Sans JP",sans-serif;
  line-height:1.65
}
button,input,select,textarea {
  font:inherit
}
button,a {
  touch-action:manipulation
}
button {
  cursor:pointer
}
a {
  color:var(--sage)
}
[hidden] {
  display:none!important
}
.page {
  width:min(100%,1080px);
  min-height:100svh;
  margin:auto;
  padding:20px 18px 112px;
  background:var(--paper)
}
.narrow {
  max-width:760px
}
.mast {
  position:relative;
  overflow:hidden;
  padding:18px 10px 24px
}
.mast:after {
  content:"✿  ✦  ✿";
  position:absolute;
  right:8px;
  top:4px;
  color:#eab78a;
  letter-spacing:12px;
  opacity:.8
}
.brand {
  font-family:Georgia,serif;
  font-size:clamp(2.2rem,8vw,4.4rem);
  line-height:1.03;
  letter-spacing:-.05em;
  margin:12px 0
}
.brand small {
  display:block;
  font-size:.66em
}
.eyebrow {
  margin:0;
  color:var(--coral);
  font-weight:800;
  letter-spacing:.08em
}
.title {
  font-size:clamp(2rem,7vw,3.1rem);
  line-height:1.2;
  margin:10px 0
}
.lead {
  color:var(--muted);
  margin:0 0 24px
}
.crumb {
  display:inline-block;
  margin:4px 0 14px;
  color:var(--muted);
  font-size:.9rem;
  text-decoration:none
}
.section-title {
  font-size:1.35rem;
  margin:28px 0 14px
}
.section-head {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px
}
.section-head .section-title {
  margin-bottom:10px
}
.btn {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-height:48px;
  padding:11px 17px;
  border:1px solid transparent;
  border-radius:999px;
  background:var(--coral);
  color:white;
  font-weight:800;
  text-decoration:none;
  text-align:center
}
.btn:disabled {
  opacity:.55;
  cursor:default
}
.btn.secondary {
  background:white;
  color:var(--sage);
  border-color:#a9c7b1
}
.btn.ghost {
  background:#f6f1e8;
  color:var(--ink)
}
.btn.danger {
  background:#a44946
}
.btn.block {
  display:flex;
  width:100%
}
.btn.small {
  min-height:42px;
  padding:8px 14px;
  font-size:.9rem
}
.link-button {
  border:0;
  background:none;
  color:var(--sage);
  text-decoration:underline;
  padding:9px
}
.actions {
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center
}
.actions>* {
  flex:1 1 auto
}
.sticky-actions {
  position:sticky;
  bottom:70px;
  z-index:4;
  padding:12px 0;
  background:linear-gradient(transparent,var(--paper) 25%)
}
.tile-grid {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px
}
.tile {
  display:flex;
  min-height:185px;
  flex-direction:column;
  justify-content:space-between;
  overflow:hidden;
  border-radius:25px;
  background:#f7ddd5;
  color:var(--ink);
  text-decoration:none;
  box-shadow:var(--shadow);
  transition:transform .15s
}
.tile:active {
  transform:scale(.98)
}
.tile .art {
  display:grid;
  place-items:center;
  min-height:135px;
  background-image:radial-gradient(circle at 80% 23%,#fff9 0 20%,transparent 21%),linear-gradient(155deg,#f8cebc,#fcefe2);
  font-size:4.5rem
}
.tile:nth-child(2) {
  background:#e5f0d9
}
.tile:nth-child(2) .art {
  background-image:linear-gradient(155deg,#c9e2c3,#eff3d7)
}
.tile:nth-child(3) {
  background:#e2f0f7
}
.tile:nth-child(3) .art {
  background-image:linear-gradient(155deg,#c9e8f5,#f0f9fa)
}
.tile:nth-child(4) {
  background:#fff0c7
}
.tile:nth-child(4) .art {
  background-image:linear-gradient(155deg,#ffe1a9,#fff7d8)
}
.tile h2,.tile strong {
  margin:0;
  padding:12px 14px;
  font-size:1.03rem;
  line-height:1.3
}
.tile img {
  display:block;
  width:100%;
  height:100%;
  max-height:190px;
  object-fit:cover
}
.tile .art:has(img) {
  padding:0
}
.tile .art:has(img) img {
  min-height:135px
}
.panel,.entry,.reader {
  border:1px solid var(--line);
  border-radius:23px;
  background:white;
  box-shadow:var(--shadow)
}
.panel {
  padding:20px;
  margin:16px 0
}
.entry {
  display:block;
  margin:12px 0;
  padding:17px;
  text-decoration:none;
  color:var(--ink)
}
.entry h3 {
  margin:0 0 5px;
  font-size:1.1rem
}
.entry .meta {
  font-size:.86rem;
  color:var(--muted);
  margin:0 0 7px
}
.excerpt {
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
  overflow:hidden;
  color:#5f6466;
  line-height:1.5;
  margin:4px 0
}
.muted {
  color:var(--muted)
}
.empty {
  padding:26px 18px;
  text-align:center;
  background:#fbf7ef;
  border-radius:19px;
  color:var(--muted)
}
.notice {
  margin:12px 0;
  color:var(--sage);
  min-height:1.5em
}
.error {
  color:#a44946
}
.chip {
  display:inline-flex;
  align-items:center;
  gap:5px;
  padding:6px 11px;
  border-radius:999px;
  background:#f3eee6;
  color:#5e5146;
  font-size:.84rem
}
.chip-row {
  display:flex;
  gap:7px;
  flex-wrap:wrap;
  margin:10px 0
}
.chip button {
  border:0;
  background:none;
  color:#a44946;
  font-size:1.2rem;
  line-height:1
}
.search {
  width:100%;
  padding:15px 18px;
  border:1px solid var(--line);
  border-radius:999px;
  background:white;
  box-shadow:var(--shadow);
  font-size:1rem
}
.reader {
  padding:22px;
  margin:15px 0
}
.reader p {
  white-space:pre-wrap;
  margin:0 0 1em;
  font-size:1.08rem;
  line-height:1.9
}
.reader p:last-child {
  margin:0
}
.info-box {
  padding:14px 17px;
  border-radius:17px;
  background:#f0f6eb;
  margin:12px 0
}
.info-box.warn {
  background:#fff1ed
}
.info-box.note {
  background:#fff7df
}
.info-box strong {
  display:block;
  margin-bottom:4px
}
.meta-line {
  font-size:.9rem;
  color:var(--muted);
  margin:8px 0
}
.segmented {
  display:flex;
  padding:4px;
  border-radius:999px;
  background:#f1ece4;
  gap:3px;
  margin:15px 0
}
.segmented button {
  flex:1;
  min-width:0;
  border:0;
  border-radius:999px;
  padding:10px 4px;
  background:transparent;
  color:var(--ink)
}
.segmented button.active {
  background:var(--coral);
  color:white;
  font-weight:800
}
.subtle-rule {
  border:0;
  border-top:1px solid var(--line);
  margin:24px 0
}
.field {
  display:block;
  margin:16px 0;
  font-weight:700
}
.field small {
  display:block;
  color:var(--muted);
  font-weight:400
}
.field input,.field textarea,.field select {
  display:block;
  width:100%;
  margin-top:6px;
  border:1px solid #d4cec5;
  border-radius:13px;
  padding:12px 14px;
  color:var(--ink);
  background:#fff;
  min-height:48px
}
.field textarea {
  min-height:145px;
  resize:vertical
}
.field input:focus,.field textarea:focus,.field select:focus,.search:focus {
  outline:2px solid #ef998e;
  outline-offset:2px
}
.row {
  display:flex;
  align-items:center;
  gap:9px
}
.row>* {
  min-width:0
}
.row input {
  flex:1
}
.form-grid {
  display:grid;
  grid-template-columns:1fr;
  gap:0 15px
}
.supplement {
  padding:14px;
  border:1px solid var(--line);
  border-radius:18px;
  margin:12px 0
}
.mini {
  font-size:.84rem
}
.bottom-nav {
  position:fixed;
  z-index:10;
  bottom:0;
  left:0;
  right:0;
  display:flex;
  justify-content:space-around;
  max-width:1080px;
  margin:auto;
  padding:7px 10px max(7px,env(safe-area-inset-bottom));
  border-top:1px solid var(--line);
  background:#fffefaf5;
  backdrop-filter:blur(10px)
}
.bottom-nav a {
  display:grid;
  place-items:center;
  min-width:75px;
  min-height:54px;
  color:#817a75;
  text-decoration:none;
  font-size:.78rem;
  font-weight:700
}
.bottom-nav a span {
  font-size:1.4rem;
  line-height:1.1
}
.bottom-nav a.current {
  color:var(--coral)
}
@media(min-width:700px) {
  .page {
    padding:35px 48px 120px
  }
  .tile-grid {
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:17px
  }
  .tile {
    min-height:220px
  }
  .tile .art {
    min-height:165px
  }
  .form-grid {
    grid-template-columns:repeat(2,minmax(0,1fr))
  }
  .entry-list {
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:0 16px
  }
  .entry-list.single {
    display:block
  }
  .entry-list .entry {
    height:calc(100% - 12px)
  }
}
.home-hero {
  min-height:250px;
  margin:-20px -18px 18px;
  padding:35px 25px 95px;
  background:#fff9ed url('./assets/home-hero.webp') center bottom / cover no-repeat
}
.home-hero .brand,.home-hero .lead,.home-hero .eyebrow {
  position:relative;
  z-index:1;
  text-shadow:0 1px 5px #fffdf8,0 1px 12px #fffdf8
}
.home-hero .lead {
  color:var(--ink);
  font-weight:700
}
.home-hero:after {
  content:none
}
.search {
  margin-bottom:22px
}
.tile strong {
  text-align:center
}
#category-grid .tile:nth-child(3) {
  background:#fff0c7
}
#category-grid .tile:nth-child(3) .art {
  background-image:linear-gradient(155deg,#ffe1a9,#fff7d8)
}
#category-grid .tile:nth-child(4) {
  background:#e2f0f7
}
#category-grid .tile:nth-child(4) .art {
  background-image:linear-gradient(155deg,#c9e8f5,#f0f9fa)
}
#category-grid .tile {
  background:#f4eadf
}
#category-grid .tile[data-category="京都"] {
  background:#f7ddd5
}
#category-grid .tile[data-category="奈良"] {
  background:#e5f0d9
}
#category-grid .tile[data-category="文化"] {
  background:#fff0c7
}
#category-grid .tile[data-category="歴史"] {
  background:#e2f0f7
}
.entry-card {
  display:flex;
  align-items:center;
  gap:14px
}
.entry-thumb {
  display:grid;
  place-items:center;
  flex:none;
  width:84px;
  height:94px;
  overflow:hidden;
  border-radius:15px;
  background:#f5eadf;
  color:var(--sage);
  font-size:2rem
}
.entry-thumb img {
  display:block;
  width:100%;
  height:100%;
  object-fit:cover
}
.entry-copy {
  min-width:0;
  flex:1
}
.entry-copy .excerpt {
  margin-bottom:0
}
.detail-art {
  height:180px;
  overflow:hidden;
  border-radius:24px;
  background:#f2eee5;
  margin:8px 0 18px
}
.detail-art img {
  display:block;
  width:100%;
  height:100%;
  object-fit:cover;
  object-position:center 44%
}
.editor-image-preview {
  height:185px;
  overflow:hidden;
  border-radius:20px;
  background:#f2eee5;
  margin:12px 0
}
.editor-image-preview img {
  display:block;
  width:100%;
  height:100%;
  object-fit:cover
}
.editor-image-preview+label input {
  padding:12px;
  background:#fff
}
#remove-image {
  margin:6px 0
}
.topic-suggestions {
  grid-column:1/-1;
  margin-top:0;
  align-content:start
}
.topic-suggestions button {
  border:0;
  cursor:pointer
}
.topic-suggestions button:focus-visible {
  outline:2px solid var(--coral)
}
.deck-card {
  margin:13px 0;
  border:1px solid var(--line);
  border-radius:23px;
  background:white;
  box-shadow:var(--shadow);
  overflow:hidden
}
.deck-card-main {
  display:flex;
  align-items:center;
  gap:14px;
  padding:14px;
  color:var(--ink);
  text-decoration:none
}
.deck-card .entry-thumb {
  position:relative
}
.deck-number {
  position:absolute;
  left:5px;
  top:5px;
  display:grid;
  place-items:center;
  width:27px;
  height:27px;
  border-radius:50%;
  background:var(--coral);
  color:white;
  font-size:.9rem;
  font-weight:800;
  box-shadow:0 1px 5px #39281f55
}
.deck-card-title {
  display:block;
  font-size:1.05rem;
  line-height:1.4
}
.deck-card-meta {
  display:block;
  margin:5px 0;
  color:var(--muted);
  font-size:.82rem
}
.deck-card-controls {
  display:flex;
  gap:8px;
  padding:9px 14px 12px;
  border-top:1px solid var(--line)
}
.deck-card-controls button {
  flex:1;
  min-width:0;
  min-height:39px;
  padding:5px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#faf7f1;
  color:var(--ink);
  font-size:.9rem
}
.deck-card-controls button:disabled {
  opacity:.35
}
.deck-card-controls .remove {
  color:#a44946
}
.deck-card {
  position:relative
}
.deck-card-main {
  min-height:116px;
  padding-right:58px
}
.deck-card-controls {
  position:absolute;
  right:10px;
  top:50%;
  transform:translateY(-50%);
  display:flex;
  flex-direction:column;
  gap:4px;
  padding:0;
  border:0
}
.deck-card-controls button {
  flex:none;
  width:34px;
  height:34px;
  min-height:34px;
  padding:0;
  border-radius:9px;
  background:#fbfaf7;
  color:var(--muted);
  font-size:1.1rem;
  line-height:1
}
.deck-card-controls .remove {
  font-size:1.25rem;
  color:#a76a66
}
@media(max-width:430px) {
  .deck-card-main {
    gap:10px;
    padding:12px 52px 12px 12px
  }
  .deck-card .entry-thumb {
    width:72px;
    height:82px
  }
}
.deck-group {
  margin:26px 0
}
.deck-group-title {
  display:flex;
  align-items:center;
  gap:10px;
  font-size:1.2rem;
  margin:0 0 10px
}
.deck-group-title:before {
  content:"✿";
  color:var(--coral)
}
.deck-count {
  display:inline-grid;
  place-items:center;
  min-width:25px;
  height:25px;
  padding:0 7px;
  border-radius:999px;
  background:#f7e7dc;
  color:#785d51;
  font-size:.78rem
}
.deck-title-list {
  display:grid;
  gap:10px
}
.deck-title-card {
  display:flex;
  align-items:center;
  gap:12px;
  width:100%;
  min-height:72px;
  padding:12px 16px;
  border:1px solid var(--line);
  border-radius:19px;
  background:white;
  color:var(--ink);
  text-align:left;
  box-shadow:var(--shadow)
}
.deck-title-card strong {
  flex:1
}
.deck-icon {
  display:grid;
  place-items:center;
  width:40px;
  height:40px;
  flex:none;
  border-radius:13px;
  background:#fff0d1;
  color:var(--coral);
  font-size:1.6rem
}
.deck-chevron {
  color:var(--muted);
  font-size:1.6rem
}
.new-deck-panel {
  margin-top:38px;
  background:#fff8ec
}
.new-deck-panel .section-title {
  margin-top:0
}
@media(min-width:700px) {
  .deck-title-list {
    grid-template-columns:repeat(2,minmax(0,1fr))
  }
}
.new-deck-link {
  margin:32px 0 20px
}
.deck-picker-card {
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
  margin:12px 0;
  padding:12px;
  border:1px solid var(--line);
  border-radius:22px;
  background:white;
  box-shadow:var(--shadow)
}
.deck-picker-card .entry-copy {
  flex:1 1 130px
}
.deck-picker-card .btn {
  flex:0 0 auto
}
.deck-picker-card .entry-thumb {
  width:76px;
  height:84px
}
.deck-picker-card .deck-card-meta {
  font-size:.76rem
}
.draft-order {
  display:grid;
  place-items:center;
  width:27px;
  height:27px;
  border-radius:50%;
  background:var(--coral);
  color:white;
  font-weight:700
}
.draft-controls {
  display:flex;
  gap:5px
}
.draft-controls button {
  width:38px;
  height:38px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#faf7f1;
  color:var(--sage)
}
.draft-controls button:disabled {
  opacity:.35
}
.script-card {
  padding:18px;
  margin:12px 0;
  border:1px solid var(--line);
  border-radius:20px;
  background:white;
  box-shadow:var(--shadow)
}
.script-card h3 {
  margin:0 0 10px;
  font-size:1.13rem
}
.script-card p {
  white-space:pre-wrap;
  line-height:1.9;
  margin:0
}
.script-language .segmented {
  margin-top:18px
}
#script-toggle {
  margin:16px 0
}
#deck-note {
  min-height:150px
}
@media(max-width:440px) {
  .deck-picker-card .btn {
    min-height:38px;
    padding:6px 11px
  }
  .deck-picker-card .entry-thumb {
    width:66px;
    height:76px
  }
  .draft-controls {
    margin-left:auto
  }
}
@media(min-width:700px) {
  .home-hero {
    margin:-35px -48px 20px;
    min-height:380px;
    padding:65px 55px 120px;
    background-position:center 57%
  }
}
.home-hero {
  text-align:right
}
#signed-in>a.btn {
  display:flex;
  width:max-content;
  margin-left:auto
}

/* トップページ：スマホでの文字とボタンの位置 */
@media (max-width: 699px) {
  .home-hero {
    padding-right: 32px
  }
  .home-hero .eyebrow {
    top: 8px;
    font-size: 0.9rem;
    margin-right: 20px
  }
  .home-hero .brand,
  .home-hero .lead {
    text-align: right;
    margin-right: 0;
    padding-right: 0
  }
  .home-hero .brand {
    font-size: 2.7rem;
    line-height: 1
  }
  .home-hero .lead {
    font-size: 0.7rem;
    line-height: 1.35
  }
  #signed-in > a.btn {
    margin-right: 18px
  }
}

/* パソコンでのカード詳細画像 */
@media (min-width: 700px) {
  .detail-art {
    height: 520px !important
  }
  .detail-art img {
    object-fit: cover !important;
    object-position: center !important
  }
}

/* トップページのタイル色 */
#signed-in .tile[href="./deck.html"] {
  background: #fff0c7
}
#signed-in .tile[href="./deck.html"] .art {
  background-image: linear-gradient(155deg, #ffe1a9, #fff7d8)
}
#signed-in .tile[href="./library.html"] {
  background: #e5f0d9
}
#signed-in .tile[href="./library.html"] .art {
  background-image: linear-gradient(155deg, #c9e2c3, #eff3d7)
}
