/* 今年の12枚（/kotoshi-12mai/）。左に月の段、右に仕上がり。狭い画面では段の下に仕上がり */
[hidden] { display: none !important; }
.k12 { --k-line: var(--hairline, #e5e7eb); --k-acc: var(--accent, #b45309); --k-soft: var(--ink-soft, #4b5563); --k-wash: #fbf6ee;
  border: 1px solid var(--k-line); background: var(--panel, #fff); padding: 20px; margin-bottom: 8px; position: relative; }
.k12.is-drag { outline: 2px dashed var(--k-acc); outline-offset: -8px; }
.k12-work { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 340px); gap: 22px; align-items: start; }
.k12-left { min-width: 0; }

/* 読み込む前 */
.k12-drop { border: 1px dashed #cdbfa8; background: var(--k-wash); padding: 26px 22px 22px; }
.k12-drop-h { margin: 0 0 4px; font-size: 21px; font-weight: 700; color: var(--ink, #1f2937); }
.k12-drop-s { margin: 0 0 18px; font-size: 14px; line-height: 1.7; color: var(--k-soft); }
.k12-go { display: flex; flex-wrap: wrap; gap: 10px; }
.k12-go .k12-btn:first-child { flex: 1 1 200px; }
.k12-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.k12-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 20px; border: 1px solid var(--k-acc); background: var(--k-acc); color: #fff;
  font-family: inherit; font-size: 16px; font-weight: 700; line-height: 1.2; text-align: center; cursor: pointer; transition: transform .08s ease, background-color .15s; }
.k12-btn:hover { background: var(--accent-dark, #92400e); }
.k12-btn:active { transform: scale(.97); }
.k12-btn.sub { background: #fff; color: var(--ink, #1f2937); border-color: var(--hairline-strong, #d1d5db); font-weight: 500; font-size: 15px; }
.k12-btn.sub:hover { border-color: var(--k-acc); color: var(--k-acc); }
.k12-btn[disabled] { opacity: .55; cursor: default; }
.k12-btn.is-busy { cursor: progress; }
label.k12-btn:focus-within, .k12-file:focus-visible + * { outline: 2px solid var(--k-acc); outline-offset: 2px; }
.k12-facts { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 6px; font-size: 13px; color: var(--k-soft); }
.k12-facts li { position: relative; padding-left: 16px; }
.k12-facts li::before { content: ""; position: absolute; left: 0; top: .6em; width: 7px; height: 7px; border-radius: 50%; background: var(--k-acc); }
.k12-how { margin: 16px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; counter-reset: k; }
.k12-how li { counter-increment: k; font-size: 13px; line-height: 1.6; color: var(--ink, #1f2937); border-top: 2px solid var(--ink, #1f2937); padding-top: 8px; }
.k12-how li::before { content: "0" counter(k); display: block; font: 500 11px/1 var(--mono); color: var(--k-acc); margin-bottom: 4px; letter-spacing: .06em; }

.k12:not(.has-photos) .k12-loaded { display: none; }
.k12.has-photos .k12-drop { display: none; }

/* 年と状態 */
.k12-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.k12-years { display: flex; flex-wrap: wrap; gap: 6px; }
.k12-year { min-height: 36px; padding: 0 12px; border: 1px solid var(--hairline-strong, #d1d5db); background: #fff; color: var(--ink, #1f2937); font: 500 14px/1 var(--mono); cursor: pointer; }
.k12-year[aria-pressed="true"] { background: var(--ink, #1f2937); border-color: var(--ink, #1f2937); color: #fff; }
.k12-tools { display: flex; gap: 6px; }
.k12-tools button { min-height: 36px; padding: 0 12px; border: 1px solid var(--hairline-strong, #d1d5db); background: #fff; font: inherit; font-size: 13px; color: var(--ink, #1f2937); cursor: pointer; }
.k12-tools button:hover { border-color: var(--k-acc); color: var(--k-acc); }
.k12-status { margin: 0 0 6px; min-height: 1.6em; font-size: 13px; line-height: 1.6; color: var(--k-soft); }
.k12-progress { height: 3px; background: var(--k-line); margin-bottom: 10px; overflow: hidden; }
.k12-progress span { display: block; height: 100%; background: var(--k-acc); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); transition: transform .2s linear; }
.k12-legend { margin: 0 0 10px; font-size: 12px; line-height: 1.7; color: var(--k-soft); }
.k12-legend i { display: inline-block; margin: 0 4px 0 2px; vertical-align: 1px; }

/* 月の段 */
.k12-months { border-top: 1px solid var(--k-line); }
.k12-row { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--k-line); }
.k12-row-h { display: grid; grid-template-columns: auto; align-content: start; gap: 2px; }
.k12-row-h b { font-size: 19px; line-height: 1.2; font-feature-settings: "palt"; }
.k12-row-h span { font: 500 11px/1.3 var(--mono); color: var(--k-soft); min-height: 1.3em; }
.k12-chosen { width: 50px; height: auto; aspect-ratio: 62 / 102; margin-top: 6px; background: #eee6d8; display: block; }
.k12-chosen.is-blank { background: repeating-linear-gradient(135deg, #f3ede3 0 6px, #ebe3d5 6px 12px); }
.k12-row.is-empty { padding: 8px 0; }
.k12-row.is-empty .k12-chosen { display: none; }
.k12-none { margin: 2px 0 0; font-size: 13px; line-height: 1.6; color: #9b9284; align-self: center; }
.k12-strip { list-style: none; margin: 0; padding: 4px 2px 8px; display: flex; gap: 8px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scrollbar-width: thin; }
.k12-strip li { flex: 0 0 auto; scroll-snap-align: start; }
.k12-strip button { position: relative; display: block; width: 76px; height: 76px; padding: 0; border: 0; background: #efe8dc; cursor: pointer; outline-offset: 2px; transition: transform .08s ease; }
.k12-strip button:active { transform: scale(.95); }
.k12-slot { position: absolute; inset: 0; overflow: hidden; }
.k12-slot:empty { background: linear-gradient(100deg, #efe8dc 30%, #f8f3ea 50%, #efe8dc 70%) 0 0 / 300% 100%; animation: k12-wait 1.2s linear infinite; }
.k12-slot canvas { width: 100%; height: 100%; object-fit: cover; display: block; }
.k12-strip button[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--k-acc); }
.k12-strip button[aria-pressed="true"]::after { content: ""; position: absolute; right: -6px; top: -6px; width: 22px; height: 22px; border-radius: 50%; background: var(--k-acc) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22'%3E%3Cpath d='M6 11.5l3.2 3.2L16 8' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 22px no-repeat; border: 2px solid #fff; }
.k12-strip button[aria-pressed="false"] .k12-slot { opacity: .78; }
.k12-strip button:hover .k12-slot { opacity: 1; }
.k12-guess, .k12-legend i { position: absolute; left: 4px; bottom: 4px; z-index: 1; padding: 2px 5px; background: #fff3c4; color: #7a4b00; border: 1px solid #e7c76a; font-family: inherit; font-size: 10px; font-weight: 700; line-height: 1.2; font-style: normal; }
.k12-legend i { position: static; }
.k12-row.is-flash .k12-chosen { animation: k12-pop .28s ease-out; }
@keyframes k12-pop { from { transform: scale(.86); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes k12-wait { to { background-position: -150% 0; } }

/* 仕上がり */
.k12-result { position: sticky; top: 16px; }
.k12-frame { background: #e8e1d4; padding: 12px; }
.k12-frame canvas { display: block; width: 100%; height: auto; aspect-ratio: 3 / 4; box-shadow: 0 1px 0 rgba(0,0,0,.06); }
.k12-result-h { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 8px; font-size: 14px; }
.k12-result-h span { font: 500 11px/1 var(--mono); color: var(--k-soft); letter-spacing: .04em; }
.k12-themes { display: flex; gap: 6px; margin: 10px 0; }
.k12-themes button { flex: 1 1 0; min-height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--hairline-strong, #d1d5db); background: #fff; font: inherit; font-size: 13px; color: var(--ink, #1f2937); cursor: pointer; }
.k12-themes button::before { content: ""; width: 14px; height: 14px; border: 1px solid rgba(0,0,0,.25); }
.k12-themes button[data-theme="paper"]::before { background: #f6f1e8; }
.k12-themes button[data-theme="ink"]::before { background: #15171b; }
.k12-themes button[aria-pressed="true"] { border-color: var(--ink, #1f2937); box-shadow: inset 0 0 0 1px var(--ink, #1f2937); font-weight: 700; }
.k12-actions { display: grid; gap: 8px; }
.k12-msg { margin: 8px 0 0; min-height: 1.5em; font-size: 13px; color: var(--ok, #2e7d43); }
.k12-fine { margin: 6px 0 0; font-size: 12px; line-height: 1.7; color: var(--k-soft); }

/* 広い画面では右に仕上がりが常に見えるので、段の左の小さな見本は出さない */
@media (min-width: 861px) {
  .k12-row { grid-template-columns: 56px minmax(0, 1fr); }
  .k12-chosen { display: none; }
}
@media (max-width: 860px) {
  .k12 { padding: 14px; }
  .k12-work { grid-template-columns: minmax(0, 1fr); }
  .k12-result { position: static; }
  .k12-frame { max-width: 420px; margin: 0 auto; }
  .k12-how { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 480px) {
  .k12-row { grid-template-columns: 58px minmax(0, 1fr); gap: 8px; }
  .k12-strip button { width: 68px; height: 68px; }
  .k12-chosen { width: 42px; }
  .k12-drop { padding: 20px 16px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .k12-row.is-flash .k12-chosen, .k12-slot:empty { animation: none; }
  .k12-btn, .k12-strip button, .k12-progress span { transition: none; }
}
.k12-all { margin: 14px 0 0; font-size: 14px; }
