@import url('./personal-manual.css');

:root { --energy-green:#276c63; --energy-soft:#e7f2ee; --energy-gold:#a06b21; --energy-danger:#9b3d35; }
* { box-sizing:border-box; }
html, body { overflow-x:clip; }
body { margin:0; background:#fbf8f2; color:#142033; }
[hidden] { display:none !important; }
button, input, select { font:inherit; }
button, .button, input[type="checkbox"] { min-height:44px; }
input[type="text"], input[type="number"], select { width:100%; border:1px solid #aebcc0; border-radius:10px; background:#fff; padding:.75rem; color:inherit; }
input[type="range"] { width:100%; min-height:44px; accent-color:var(--energy-green); }
:focus-visible { outline:3px solid #e88a55; outline-offset:3px; }
.skip-link { position:fixed; left:1rem; top:-5rem; z-index:100; background:#142033; color:#fff; padding:.75rem 1rem; }
.skip-link:focus { top:1rem; }
.tool-header { display:flex; justify-content:space-between; gap:1rem; align-items:center; padding:1rem clamp(1rem,4vw,3rem); border-bottom:1px solid #e2ddd4; }
.brand-link { color:inherit; text-decoration:none; font-weight:800; }
.storage-state { margin:0; color:#52636b; text-align:right; font-size:.9rem; }
.intro-shell, .list-shell, .result-shell { width:min(1120px,calc(100% - 2rem)); margin:0 auto; padding:clamp(2.5rem,7vw,5rem) 0; }
h1 { font-size:clamp(2.2rem,6vw,4.4rem); line-height:1.12; margin:.35rem 0 1rem; }
.eyebrow { color:var(--energy-gold); font-weight:800; letter-spacing:.14em; font-size:.78rem; }
.lead { font-size:clamp(1.05rem,2vw,1.35rem); line-height:1.75; color:#42555e; }
.intro-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:1rem; margin:2.5rem 0; }
.intro-grid article, .editor-card, .energy-card, .result-section, .result-options { background:#fff; border:1px solid #e2ddd4; border-radius:16px; padding:1.25rem; }
.intro-grid h2 { margin-top:0; font-size:1.1rem; }
.notice { border-left:4px solid var(--energy-gold); background:#fff7e9; padding:1rem 1.2rem; border-radius:0 12px 12px 0; line-height:1.7; }
.button-row { display:flex; flex-wrap:wrap; gap:.75rem; margin-top:1.5rem; }
.button { border:1px solid #83989f; background:#fff; color:#142033; border-radius:999px; padding:.65rem 1.1rem; cursor:pointer; }
.button--primary { color:#fff; background:var(--energy-green); border-color:var(--energy-green); }
.button--quiet { background:transparent; }
.button--danger { color:var(--energy-danger); border-color:#c98f89; }
.button:disabled { opacity:.48; cursor:not-allowed; }
.form-message { min-height:1.5rem; color:#52636b; }
.section-heading { max-width:760px; }
.section-heading h1 { font-size:clamp(2rem,5vw,3.8rem); }
.editor-card { margin:2rem 0; }
.editor-heading { display:flex; justify-content:space-between; align-items:center; gap:1rem; }
.editor-heading h2 { margin:.2rem 0 1rem; }
#itemForm { display:grid; grid-template-columns:1fr 1fr; gap:1rem; }
.field-wide { grid-column:1/-1; }
.field-group { display:grid; gap:.5rem; min-width:0; }
.field-group label, .field-group legend { font-weight:800; }
.field-hint { color:#5d6c73; font-size:.92rem; line-height:1.55; }
.emotion-options { display:flex; flex-wrap:wrap; gap:.5rem; }
.emotion-options label { display:flex; align-items:center; gap:.4rem; border:1px solid #b8c3c5; border-radius:999px; padding:.35rem .7rem; font-weight:500; background:#fff; }
.duration-fields { grid-template-columns:1fr 1fr; align-content:start; }
.duration-fields legend { grid-column:1/-1; }
.list-toolbar { display:grid; grid-template-columns:1fr 1fr auto; gap:1rem; align-items:end; padding:1rem; background:var(--energy-soft); border-radius:14px; }
.list-toolbar label { display:grid; gap:.4rem; font-weight:800; }
.list-content { display:grid; gap:1rem; margin:1.5rem 0; }
.empty-list { padding:2rem; border:1px dashed #9babae; border-radius:14px; text-align:center; color:#52636b; }
.energy-card { display:grid; grid-template-columns:minmax(0,2fr) minmax(120px,.6fr) minmax(0,1fr) minmax(100px,.6fr) auto; gap:1rem; align-items:start; }
.energy-card h3 { margin:0; overflow-wrap:anywhere; }
.energy-score { font-size:1.35rem; font-weight:900; color:var(--energy-green); }
.tag-list { display:flex; flex-wrap:wrap; gap:.35rem; }
.tag { background:#edf3f4; border-radius:999px; padding:.25rem .55rem; font-size:.88rem; }
.card-actions { display:flex; flex-wrap:wrap; gap:.35rem; justify-content:flex-end; }
.card-actions button { min-height:44px; border:1px solid #b8c3c5; background:#fff; border-radius:8px; padding:.4rem .65rem; }
.include-controls { grid-column:1/-1; display:flex; flex-wrap:wrap; gap:1rem; border-top:1px solid #eee8de; padding-top:.8rem; }
.include-controls label, .option-grid label, .check-row { display:flex; gap:.6rem; align-items:flex-start; line-height:1.5; }
.result-options { margin-top:2rem; }
.option-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:1rem; }
.result-content { display:grid; gap:1rem; margin-top:2rem; }
.result-section h2 { color:var(--energy-green); }
.result-section li, .result-section p { line-height:1.7; overflow-wrap:anywhere; }
.result-table { width:100%; border-collapse:collapse; }
.result-table th, .result-table td { border-bottom:1px solid #e6e0d7; padding:.7rem; text-align:left; vertical-align:top; }
.result-disclaimer { margin-top:2rem; }
.dialog-backdrop { position:fixed; inset:0; z-index:80; background:rgba(20,32,51,.68); display:grid; place-items:center; padding:1rem; }
.dialog-card { width:min(560px,100%); max-height:90vh; overflow:auto; background:#fff; border-radius:18px; padding:1.5rem; position:relative; }
.dialog-close { position:absolute; right:.8rem; top:.6rem; border:0; background:transparent; font-size:2rem; }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }

@media (max-width:820px) {
  .intro-grid, .option-grid { grid-template-columns:1fr; }
  .list-toolbar { grid-template-columns:1fr 1fr; }
  .list-toolbar .button { grid-column:1/-1; }
  .energy-card { grid-template-columns:1fr 1fr; }
  .energy-card > :first-child, .include-controls { grid-column:1/-1; }
  .card-actions { justify-content:flex-start; grid-column:1/-1; }
}
@media (max-width:640px) {
  .tool-header { align-items:flex-start; }
  #itemForm, .list-toolbar, .duration-fields, .energy-card { grid-template-columns:1fr; }
  .field-wide, .duration-fields legend, .list-toolbar .button, .energy-card > :first-child, .include-controls, .card-actions { grid-column:1; }
  .button-row .button { width:100%; }
  .result-table, .result-table tbody, .result-table tr, .result-table td { display:block; width:100%; }
  .result-table thead { display:none; }
  .result-table tr { border:1px solid #e6e0d7; border-radius:12px; padding:.5rem; margin-bottom:.75rem; }
  .result-table td { border:0; padding:.35rem .5rem; }
  .result-table td::before { content:attr(data-label) '：'; font-weight:800; }
}
@media print {
  .tool-header, .result-actions, .result-disclaimer, .dialog-backdrop { display:none !important; }
  body { background:#fff; }
  .result-shell { width:100%; padding:0; }
  .result-section { break-inside:avoid; margin-bottom:12pt; }
  .result-table thead { display:table-header-group; }
  .print-part-title { break-after:avoid; margin-top:24pt; }
}
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { scroll-behavior:auto !important; transition:none !important; } }
