:root{font-family:-apple-system,BlinkMacSystemFont,"Hiragino Kaku Gothic ProN",sans-serif;color:#725619;background:#fbf8ee;font-size:15px;--accent:#806018;--tint:#fff8df;--edge:#dfd2a5}*{box-sizing:border-box}body{margin:0}.app{max-width:780px;margin:auto;padding:24px 18px calc(110px + env(safe-area-inset-bottom))}header{margin:10px 0 22px}header small{letter-spacing:2px}h1{font-size:27px;margin:8px 0}h2{font-size:20px;margin:25px 0 14px}h3{font-size:17px;margin:0 0 15px}h4{margin:22px 0 8px}p{line-height:1.7;white-space:pre-line;font-size:13px}small,.muted{font-size:12px}.help{--accent:#276242;--tint:#ecf7ed;--edge:#bfd9c5;color:var(--accent)}.mew{--accent:#963b68;--tint:#fff0f6;--edge:#edc2d7;color:var(--accent)}.delibird{--accent:#ad3d39;--tint:#fff1ee;--edge:#ecc5bf;color:var(--accent)}button,input,select{font:inherit;color:inherit;border:1px solid var(--edge);border-radius:10px;padding:11px 12px;background:#fff;max-width:100%;min-width:0}button{cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent}button:disabled{opacity:.45;cursor:default}button:active:not(:disabled){background:var(--tint)}button:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid var(--accent);outline-offset:2px}button:focus:not(:focus-visible){outline:none}input,select{display:block;width:100%;margin-top:6px}input[type=datetime-local]{width:100%;min-width:0;max-width:100%;font-size:16px;appearance:none;-webkit-appearance:none}input::-webkit-date-and-time-value{text-align:left;min-width:0}label{display:block;font-size:13px;margin:12px 0}.check{display:flex;align-items:center;gap:8px}.check input{display:inline;width:auto;margin:0;accent-color:var(--accent)}.card{border:1px solid var(--edge);background:#fffefa;border-radius:16px;padding:18px;margin-bottom:15px;min-width:0}.hero{border:1px solid var(--edge);background:#fff8dc;border-radius:16px;padding:20px;margin-bottom:18px}.total{font-size:38px;font-weight:700;margin:8px 0}.row{display:flex;justify-content:space-between;gap:10px;padding:11px 0;border-bottom:1px solid var(--edge);font-size:13px}.row:last-child{border-bottom:0}.row strong{white-space:nowrap}.record-slots{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-bottom:22px}.help-card{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:7px;padding:13px;min-height:78px;min-width:0;text-align:left;border:1px solid var(--edge);border-radius:12px;background:var(--tint);overflow-wrap:anywhere}.help-card strong{font-size:15px;line-height:1.5}.mew-actions{display:flex;gap:8px;width:100%;margin-top:4px}.mew-actions button{flex:1;padding:9px 4px}.filters{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 12px}.filters label{min-width:0}.tabs{position:fixed;bottom:0;left:0;right:0;display:flex;max-width:780px;margin:auto;padding:8px 10px calc(8px + env(safe-area-inset-bottom));gap:4px;background:#fffcf1;border-top:1px solid #dfd2a5;z-index:10}.tabs button{flex:1;padding:13px 0;font-size:13px;background:transparent;border-color:transparent}.tabs [aria-current]{background:#f2dfa0;border-color:#d0b862;font-weight:700}#notice{min-height:22px}.catalog{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;max-height:270px;overflow:auto;padding:4px}.catalog button{font-size:13px;text-align:left}.calendar{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:4px;margin:14px 0}.weekday{text-align:center;font-size:11px}.day{padding:7px 2px;font-size:11px;min-width:0;display:flex;flex-direction:column;gap:4px;align-items:center}.day span{font-weight:600;word-break:break-all}.day.selected{outline:2px solid #a18023;outline-offset:-2px}.event-day{background:#fff0ba}.legend{font-size:11px}.table-scroll{overflow:auto}table{border-collapse:collapse;min-width:520px;width:100%;font-size:12px}td,th{border:1px solid var(--edge);padding:8px;text-align:center;white-space:pre-line}th{background:var(--tint)}.danger{font-size:12px;margin:8px 4px 0 0}details{padding:12px 0;font-size:13px}summary{cursor:pointer}[hidden]{display:none!important}@media(max-width:400px){.app{padding-left:12px;padding-right:12px}.card{padding:13px}.row{font-size:12px}.help-card{padding:10px}.help-card strong{font-size:13px}.filters{gap:0 8px}.day{font-size:10px}.total{font-size:32px}}

/* 日付・月を含むすべての入力を16px以上にし、iPhoneの自動拡大を防ぎます。 */
input,select,textarea{font-size:16px;width:100%;max-width:100%;min-width:0;box-sizing:border-box}
input[type=date],input[type=month],input[type=datetime-local]{display:block;appearance:none;-webkit-appearance:none;inline-size:100%;min-inline-size:0;max-inline-size:100%;height:46px;padding:10px 8px;overflow:hidden}
input::-webkit-date-and-time-value{display:block;width:100%;min-width:0;text-align:left;white-space:nowrap}
label{min-width:0;max-width:100%}.filters>*{min-width:0}.card{overflow-wrap:anywhere}
#notice{position:fixed;left:50%;bottom:calc(84px + env(safe-area-inset-bottom));transform:translate(-50%,12px);width:max-content;max-width:calc(100vw - 28px);padding:12px 18px;background:#554014;color:#fff;border-radius:12px;box-shadow:0 4px 20px #0003;z-index:40;opacity:0;pointer-events:none;margin:0;transition:opacity .18s,transform .18s}
#notice.shown{opacity:1;transform:translate(-50%,0)}
.day{background:transparent;border:0;border-radius:0;padding:4px 0}.day-number{font-size:13px;font-weight:800}.candy-values{display:flex;flex-direction:column;align-items:center;gap:4px;border:1px solid #ded1a5;border-radius:7px;padding:6px 0;width:100%;background:#fffefa}.day.selected{outline:none}.day.selected .candy-values{border:2px solid #a18023;padding:5px 0}.day span.candy-values{word-break:normal}.day.event-day{border-radius:7px;background:#fff0ba}
.section-head,.history-head{display:flex;align-items:center;justify-content:space-between;gap:10px}.section-head h2{margin:16px 0}.history-head{align-items:flex-start}.history-actions,.row-actions{display:flex;gap:5px;flex-shrink:0}.history-actions button{padding:7px 9px;font-size:12px;margin:0}.registered-row{display:flex;align-items:center;justify-content:space-between;gap:8px;border-bottom:1px solid var(--edge);padding:9px 0;min-width:0}.registered-row>strong{font-size:14px;overflow-wrap:anywhere}.row-actions button{font-size:11px;margin:0;padding:7px}.registered-row:last-child{border:0}
dialog{border:1px solid #dacda2;border-radius:14px;padding:18px;color:#725619;background:#fffdf5;width:min(640px,calc(100vw - 24px));max-width:calc(100vw - 24px);max-height:calc(100dvh - 30px);overflow:auto}dialog::backdrop{background:#0006}dialog p{color:#a33836}#history-edit-form>.section-head{position:sticky;top:-18px;background:#fffdf5;z-index:1}.history-head strong{font-size:14px}#history-list .card{padding:14px}#history-list .card>p{margin:10px 0}.legend{display:flex;gap:8px;flex-wrap:wrap}
@media(max-width:430px){.filters:has(input[type=date]),.filters:has(input[type=month]){grid-template-columns:minmax(0,1fr)}.calendar{gap:3px}.history-actions button{padding:7px}dialog{padding:14px}.registered-row>strong{font-size:13px}}

/* 共通期間は狭い画面でも横並び。日付欄の幅を優先します。 */
#summary .summary-filters{grid-template-columns:minmax(78px,.65fr) minmax(170px,1.35fr);gap:0 8px}
.summary-filters>label:last-child{grid-column:1 / -1}
.position-table{table-layout:fixed;min-width:420px}
.position-table th:first-child{width:62px;padding:6px 3px;font-size:11px;overflow-wrap:anywhere}
.position-table td,.position-table th{padding:7px 3px}
.position-table caption{text-align:center;padding:6px;font-weight:700}
.quantity{white-space:nowrap}.quantity-number{font-size:1.25em;font-weight:700;font-variant-numeric:tabular-nums}.quantity-unit{font-size:.85em;font-weight:400;margin-left:1px}
.total .quantity-number{font-size:1em}.total .quantity-unit{font-size:.48em}
.hero .row strong{white-space:normal;text-align:right}.history-head>strong{min-width:0}
@media(max-width:400px){.hero{padding:16px}.hero .row{gap:6px}.position-table{min-width:390px}}

#create-mew-image{width:100%}

/* ゆめのかけらの入力・集計。既存の色とカードを引き継ぎます。 */
.shards{--accent:#806018;--tint:#fff8df;--edge:#dfd2a5;color:var(--accent)}
.shard-skill-form{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:end}.shard-skill-form button{margin-bottom:12px}.shard-skill-form label{margin-top:0}
.registered-row:has(.shard-setting){flex-wrap:wrap}.shard-setting{flex-basis:100%;margin:0 0 4px;font-size:12px}.shard-setting input{flex-shrink:0}
#shards .shard-filters{grid-template-columns:minmax(78px,.65fr) minmax(170px,1.35fr);gap:0 8px}
.tabs button[data-tab=shards]{font-size:11px;line-height:1.4;overflow-wrap:anywhere}
.shard-individual{overflow-wrap:anywhere}.shard-individual .row{flex-wrap:wrap}

/* 44pxのタップ領域を持つ、記録画面専用の固定日付。 */
/* 基準日と「今日に戻る」は同じ行。狭い画面ではこの行に横幅を確保します。 */
.summary-date-control{display:flex;align-items:flex-end;gap:8px;min-width:0}.summary-date-control label{flex:1;min-width:0}.summary-date-control button{flex:none;margin-bottom:12px;padding:11px 9px;font-size:12px;height:46px}
#summary .summary-filters{grid-template-columns:minmax(100px,.7fr) minmax(270px,1.3fr)}
#profile-species{font-size:24px;font-weight:700;margin:16px 0;color:inherit}
#profile-form .profile-stats{grid-template-columns:minmax(60px,.8fr) minmax(74px,.9fr) minmax(115px,1.4fr);gap:8px}
.profile-stats input,.profile-stats select{padding:10px 5px}.profile-stats label{font-size:12px}
.shard-amount-buttons{display:flex;gap:8px;flex-wrap:wrap}.shard-amount-buttons button{flex:1;min-width:90px}
.weekly-bars{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:7px;align-items:end;margin-top:16px}
.weekly-column{display:flex;flex-direction:column;align-items:center;min-width:0;gap:5px}.weekly-value{font-size:12px;font-weight:700;overflow-wrap:anywhere;text-align:center;min-height:30px;display:flex;align-items:flex-end;justify-content:center}
.weekly-track{width:100%;height:125px;border-bottom:1px solid var(--edge);position:relative;display:flex;align-items:flex-end;justify-content:center;background:#80601805}.weekly-bar{width:70%;background:var(--accent);border-radius:5px 5px 0 0;min-height:0;opacity:.72}.weekly-weekday{font-size:12px}.weekly-date{font-size:11px}.weekly-range{margin-bottom:0}
#roster-other-toggle{margin:8px 0 12px}
@media(max-width:540px){#summary .summary-filters{grid-template-columns:minmax(0,1fr)}.summary-date-control{grid-column:1/-1}.weekly-bars{gap:4px}.weekly-value{font-size:10px}.weekly-date{font-size:10px}}
/* 元の日付カードを記録画面の中だけで固定します。 */
.record-date-card{position:sticky;top:env(safe-area-inset-top,0px);z-index:20;display:flex;align-items:center;gap:8px}
.record-date-card #datetime{flex:1;min-width:0;width:0;margin:0;padding-left:5px;padding-right:2px}
.record-date-card .check{flex:none;white-space:nowrap;margin:0;gap:4px;font-size:12px}
.record-date-card .check input{width:18px;height:18px;flex:none}
.pokemon-nickname{font-size:.82em;font-weight:inherit}
#shard-research-form .research-fields{grid-template-columns:repeat(2,minmax(0,1fr))}

/* 曜日は入力値には混ぜず、日付選択欄のすぐ下に添えます。 */
.date-field{display:block;min-width:0;width:100%}.date-weekday{display:block;font-size:12px;margin-top:3px}
.record-date-card>.date-field{flex:1;min-width:0;width:0}.record-date-card>.date-field #datetime{width:100%}
.mew-position-table{min-width:0;font-size:10px}.mew-position-table th:first-child{width:28px;font-size:10px;padding:4px 1px}.mew-position-table td,.mew-position-table th{padding:6px 1px;overflow-wrap:anywhere}
.mew-position-table th:last-child{width:40px;font-size:10px}.mew-position-table .quantity-number{font-size:12px}
#mew-skill-only{margin-bottom:12px}#edit-mew-fields{border-top:1px solid var(--edge);margin-top:12px}

/* 日時の標準入力を重ね、表示だけ曜日入りの形式に統一します。 */
.record-date-card>.record-datetime-field{position:relative;display:flex;align-items:center;height:46px;min-width:0;border:1px solid var(--edge);border-radius:10px;background:#fff}
.record-date-card>.record-datetime-field #datetime{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer;z-index:1}
.record-date-card .record-datetime-field .date-weekday{display:block;margin:0;padding:0 5px;font-size:clamp(12px,3.65vw,16px);white-space:nowrap;pointer-events:none}
.record-datetime-field:focus-within{outline:3px solid var(--accent);outline-offset:2px}
@media(max-width:400px){.record-date-card{padding:10px 7px;gap:4px}.record-date-card .check{font-size:11px;gap:2px}.record-date-card .check input{width:16px;height:16px}}

/* 通知は上部。固定日時があるときの位置は実際の高さから調整します。 */
#notice{bottom:auto;top:12px;transform:translate(-50%,-8px)}
#notice.shown{transform:translate(-50%,0)}
.research-card>summary{font-size:20px;font-weight:700;padding:6px 0}

/* 日付の見た目だけを統一し、標準の日付選択と保存値は維持します。 */
.formatted-date-field{position:relative;display:flex;align-items:center;min-width:0;height:46px;margin-top:6px;border:1px solid var(--edge);border-radius:10px;background:#fff}
.formatted-date-field>input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;z-index:1;cursor:pointer}
.formatted-date-field>.date-weekday{margin:0;padding:0 7px;font-size:14px;white-space:nowrap;pointer-events:none}
.formatted-date-field:focus-within{outline:3px solid var(--accent);outline-offset:2px}
.record-date-card>.formatted-date-field{margin-top:0}
.period-controls{display:grid;grid-template-columns:minmax(60px,.7fr) minmax(0,1.6fr) auto;gap:6px;align-items:center}
.period-controls label{margin:0;font-size:12px}
.period-controls button{padding:7px 6px;font-size:12px;white-space:nowrap}
.period-controls>select{grid-column:1;grid-row:2;margin:0;height:46px;padding:8px 4px}
.period-controls>.period-date{grid-column:2/4;grid-row:2;min-width:0}
.period-controls .formatted-date-field{margin:0}
.weekly-date{overflow-wrap:anywhere;line-height:1.35;text-align:center}

/* 3タブ共通の期間ナビゲーション */
.period-picker-top{display:grid;grid-template-columns:44px minmax(0,1fr) 44px;align-items:center;gap:6px}
.period-picker-top>button{min-height:44px;padding:8px 3px}
.period-picker-date{font-weight:700;font-size:17px;white-space:nowrap;grid-column:2}
.period-picker-top>button:last-child{grid-column:3}
.period-picker-bottom{display:flex;align-items:center;justify-content:space-between;gap:6px;margin-top:10px}
.period-picker-range{min-width:0;font-size:12px;overflow-wrap:anywhere}
.period-picker-bottom>button{flex:none;font-size:12px;padding:10px 7px;white-space:nowrap}
.period-picker-dialog{width:min(420px,calc(100vw - 24px));padding:18px;border:1px solid var(--edge);border-radius:16px;background:#fffefa;color:inherit}
.period-picker-dialog::backdrop{background:#0005}
.period-picker-dialog h2{font-size:18px;margin-top:0}
.period-picker-choices{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px}
.period-picker-choices button{padding:11px 4px}
.period-picker-choices [aria-pressed=true]{background:#f2dfa0;border-color:#a18023;font-weight:700}

.tabs .tab-line{white-space:nowrap}
.shard-skill-total>strong{white-space:pre-line;text-align:right;line-height:1.6}

/* R枠はクリーム色の縁と太字で控えめに強調します。 */
.leader-slot{border:2px solid #b79a52!important;box-shadow:inset 0 0 0 2px #fff7dc}
#team-slots>.leader-slot{padding:10px;border-radius:12px;background:#fff8e3}
.leader-slot strong,.leader-slot h3,.leader-slot select{font-weight:700}
.heading-with-total{display:flex;justify-content:space-between;align-items:center;gap:8px}
.heading-total{font-size:13px;white-space:nowrap;font-weight:600;margin-left:auto}
.heading-total .quantity-number{font-size:16px}
.copy-skill-card{background:#fffbea}

/* 記録タブ専用。日時の下書きは「決定」まで保存しません。 */
.record-datetime-field:has(.record-picker-trigger)>.date-weekday{display:none}
.record-picker-trigger{width:100%;height:100%;border:0;padding:0 5px;text-align:left;font-size:clamp(12px,3.65vw,16px);white-space:nowrap;background:transparent}
.record-picker{width:min(440px,calc(100% - 24px));max-height:calc(100dvh - 24px);padding:20px;border:1px solid var(--edge);border-radius:22px;background:#fffefa;color:inherit;overflow:auto}
.record-picker::backdrop{background:rgba(70,51,18,.3)}
.record-picker h2{margin:0 0 16px}
.record-picker-head{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-bottom:14px}
.record-picker-head strong{font-size:21px}.record-picker-head button{width:46px;height:46px;padding:0}
.record-picker-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:3px;text-align:center}
.record-picker-grid>span{padding:5px 0;font-size:13px}
.record-picker-grid button{min-height:42px;padding:8px 0;border-color:transparent;background:transparent;font-size:17px}
.record-picker-grid button[aria-pressed=true]{background:#f2dfa0;border-color:#b99537;font-weight:700;border-radius:50%}
.record-picker-selected{margin:12px 0 0;text-align:center;font-weight:700}
.record-picker-time{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);gap:12px;align-items:center}
.record-picker-time label{margin:12px 0 0}.record-picker-time>span{font-size:28px;padding-top:25px}
.record-picker-time select{height:68px;font-size:30px;font-weight:700;text-align:center;background:#fbf8ee;padding:8px}
.record-picker-actions{display:flex;gap:12px}.record-picker-actions button{flex:1;min-height:52px;font-size:17px;font-weight:700}.record-picker-actions button[type=submit]{background:#f2dfa0;border-color:#c8a545}
@media(max-height:650px){.record-picker{padding:14px}.record-picker-grid button{min-height:34px;padding:4px}.record-picker h2{margin-bottom:8px}.record-picker-time select{height:56px}}

/* 合計カード内：数字と単位の強弱を保ち、3列の右端を揃えます。 */
.total-breakdown{width:100%;min-width:0;border-collapse:collapse;font-size:13px;margin-top:10px}
.total-breakdown th,.total-breakdown td{border:0;border-bottom:1px solid var(--edge);padding:10px 0 10px 8px;background:transparent;text-align:right;white-space:nowrap}
.total-breakdown th:first-child{padding-left:0;text-align:left;font-weight:400;white-space:normal}
.total-breakdown thead th{font-size:11px;font-weight:400;padding-top:0;padding-bottom:6px}
.total-breakdown tbody tr:last-child>*{border-bottom:0}
.total-breakdown td{font-variant-numeric:tabular-nums}
@media(max-width:360px){.total-breakdown{font-size:12px}.total-breakdown th,.total-breakdown td{padding-left:5px}}

.record-picker-trigger{font-size:16px;font-weight:700;letter-spacing:-.35px}
.period-picker-compact .period-picker-date{font-size:clamp(12px,3.4vw,16px);letter-spacing:-.3px}
.period-picker-compact .period-picker-bottom{justify-content:flex-end}
#candy-list{max-height:240px;overflow-y:auto;-webkit-overflow-scrolling:touch}
#candy-list>.row{height:48px;align-items:center;padding-top:8px;padding-bottom:8px}
.record-picker .period-picker-choices{margin-bottom:16px}

.period-picker .period-quick-buttons{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:5px;margin-top:10px}
.period-quick-buttons>.period-picker-choices{display:contents}
.period-picker .period-quick-buttons button{padding:10px 2px;min-height:44px;font-size:13px;white-space:nowrap}
.comma-input{font-size:16px;font-variant-numeric:tabular-nums}
