/* Seeing Diary — the daily square game. Builds on seeing.css tokens/components. */
.dmain { padding-top: 28px; padding-bottom: 48px; }
.dhead { display: grid; gap: 14px; align-items: end; margin-bottom: 22px; }
@media (min-width: 880px) { .dhead { grid-template-columns: 1fr auto; } }
.dhead h1 { font-size: clamp(36px, 6vw, 64px); line-height: 1; letter-spacing: -.03em; margin: 0 0 12px; font-weight: 800; }
.dtabs button { min-height: 40px; }
.top nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }

.ed { display: grid; gap: 22px; align-items: start; }
@media (min-width: 980px) { .ed { grid-template-columns: minmax(0, 1fr) 360px; } }
.ed-side { display: grid; gap: 14px; }
@media (min-width: 980px) { .ed-side { position: sticky; top: 72px; max-height: calc(100vh - 84px); overflow-y: auto; padding-right: 4px; scrollbar-width: thin; } }

.panel { background: var(--paper2); border-radius: 16px; padding: 16px; margin-bottom: 0; }
.panel h2 { font-size: 17px; margin: 0 0 10px; }
.ph { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.dlab { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--mid); margin: 14px 0 6px; }
.cap { color: var(--mid); margin: 10px 0 0; }
.row.tight { margin: 10px 0 0; gap: 6px; }
.btn.danger { color: #c8242f; border-color: #c8242f; }
.picker { position: relative; overflow: hidden; }
.picker input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.ibtn { width: 40px; height: 36px; border-radius: 10px; border: 2px solid var(--ink); background: transparent; font-size: 18px; cursor: pointer; }
.ibtn:disabled { opacity: .35; cursor: default; }
label.f { display: block; font-size: 13px; margin: 0 0 6px; color: var(--mid); }
.save input[type=text] { width: 100%; min-height: 42px; border-radius: 10px; border: 2px solid var(--line); background: var(--paper); padding: 0 12px; margin-bottom: 10px; }
.save .btn { width: 100%; }

/* prompt */
.prompt-card { background: #161514; color: #f6f4ee; border-radius: 18px; padding: 16px 18px 14px; margin-bottom: 14px; }
.prompt-card .kicker { color: #bdb9ae; margin: 0; }
.pc-top { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; }
.prompt-card .btn.ghost { color: #f6f4ee; border-color: #6b6860; }
.p-word { font-size: clamp(28px, 4.4vw, 44px); font-weight: 800; letter-spacing: -.02em; line-height: 1.05; margin: 10px 0 10px; }
.rules { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.rules li { font-size: 13.5px; border: 1px solid #4a4842; border-radius: 999px; padding: 5px 12px 5px 10px; display: flex; gap: 6px; align-items: center; }
.rules li::before { content: "○"; color: #8d897f; }
.rules li.ok { border-color: #2fae62; }
.rules li.ok::before { content: "✓"; color: #2fae62; font-weight: 700; }

/* canvas */
.cv-wrap { border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: repeating-conic-gradient(var(--paper2) 0 25%, var(--paper) 0 50%) 0 0 / 24px 24px; }
#cv { display: block; width: 100%; height: auto; aspect-ratio: 1; touch-action: none; user-select: none; -webkit-user-select: none; }
#cv.draw { cursor: crosshair; }
#cv .el { cursor: move; }
#cv.draw .el { cursor: crosshair; }
#cv .hdl { cursor: nwse-resize; }
#cv .hdl.rot { cursor: grab; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; margin-top: 12px; }
.toolbar .row.tight { margin: 0; }

/* add */
.surprise { width: 100%; background: var(--yellow); color: var(--on-light); border-color: var(--yellow); }
.kinds { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.kinds button { aspect-ratio: 1; border-radius: 10px; border: 2px solid var(--line); background: var(--paper); cursor: pointer; padding: 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 10.5px; color: var(--mid); }
.kinds button:hover { border-color: var(--ink); color: var(--ink); }
.kinds svg { width: 70%; height: 60%; }

/* palette */
.pal { display: flex; flex-wrap: wrap; gap: 6px; }
.pal button { width: 40px; height: 40px; border-radius: 10px; border: 2px solid var(--line); cursor: pointer; }
.pal button[aria-pressed="true"] { border-color: var(--ink); box-shadow: 0 0 0 2px var(--paper) inset, 0 0 0 1px var(--ink); }

/* inspector */
.ctl { display: grid; grid-template-columns: 92px 1fr 44px; gap: 8px; align-items: center; font-size: 13px; margin: 4px 0; }
.ctl input[type=range] { min-height: 28px; }
.ctl output { font-family: var(--mono); font-size: 11.5px; color: var(--mid); text-align: right; }
.seg.mini button { min-height: 30px; font-size: 13px; padding: 0 12px; }

/* layers */
.layers { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: 210px; overflow-y: auto; }
.layers button { width: 100%; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); background: var(--paper); border-radius: 8px; padding: 4px 8px; cursor: pointer; text-align: left; font-size: 13px; }
.layers button[aria-pressed="true"] { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.layers svg { width: 28px; height: 28px; flex: none; }
.layers .empty { color: var(--mid); font-size: 13px; padding: 6px 2px; }

/* score */
.score:empty { display: none; }
.score { margin-top: 12px; border-radius: 12px; background: var(--paper); border: 1px solid var(--line); padding: 12px; font-size: 14px; }
.score .total { font-size: 30px; font-weight: 800; line-height: 1; }
.score ul { margin: 8px 0 0; padding-left: 18px; }

/* results */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat { background: var(--paper2); border-radius: 14px; padding: 14px; }
.stat b { display: block; font-size: 30px; line-height: 1.05; font-weight: 800; }
.stat span { font-size: 13px; color: var(--mid); }
#view-results .two { margin-bottom: 14px; gap: 14px; }
#view-results > .panel { margin-bottom: 14px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal .wd { font: 600 10px var(--mono); color: var(--mid); text-align: center; text-transform: uppercase; }
.cell { aspect-ratio: 1; border-radius: 7px; border: 1px dashed var(--line); position: relative; overflow: hidden; padding: 0; background: transparent; }
button.cell { cursor: pointer; border-style: solid; }
.cell svg { width: 100%; height: 100%; display: block; }
.cell .d { position: absolute; left: 3px; top: 1px; font: 600 9.5px var(--mono); color: var(--mid); mix-blend-mode: difference; color: #fff; }
.cell.today { outline: 2px solid var(--accent); outline-offset: 1px; }
.cell[aria-pressed="true"] { outline: 3px solid var(--ink); outline-offset: 1px; }
.bars { display: grid; gap: 5px; }
.bar { display: grid; grid-template-columns: 96px 1fr 30px; gap: 8px; align-items: center; font-size: 13px; }
.bar i { display: block; height: 14px; border-radius: 4px; background: var(--ink); min-width: 3px; }
.bar em { font-style: normal; font-family: var(--mono); font-size: 11.5px; color: var(--mid); text-align: right; }
.bar .sw { width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--line); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.chips button { border: 2px dashed var(--ink); background: transparent; border-radius: 999px; min-height: 34px; padding: 0 12px; cursor: pointer; font-size: 13px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.gallery figure { margin: 0; }
.gallery figcaption { font-size: 11px; color: var(--mid); margin-top: 3px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-img { max-width: 320px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); margin-bottom: 10px; }
.detail-img svg { display: block; width: 100%; height: auto; }
.detail h3 { font-size: 22px; margin: 0 0 4px; }
.detail ul { margin: 6px 0; padding-left: 18px; font-size: 14px; }
.empty-note { color: var(--mid); font-size: 14px; }
