:root {
  --rose: #916370;
  --ivory: #FAF6F3;
  --gold: #C4A18B;
  --ink: #63444D;
  --soft: #EEE0E2;
  --dust: #B69096;
  --sage: #739586;
  --white: #FFFFFF;
  --muted: #735e64;
  --line: #e8dcdb;
  --shadow: 0 10px 30px #63444d08;
  color-scheme: light;
  background: var(--ivory);
  color: var(--ink);
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
}
:root.large { font-size: 115%; }
* { box-sizing: border-box; }
body { margin: 0; line-height: 1.55; }
button, input, select, textarea { font: inherit; color: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
a { color: inherit; text-underline-offset: .2em; }
:focus-visible { outline: 3px solid var(--rose); outline-offset: 3px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.75rem, 3vw, 2.55rem); line-height: 1.22; letter-spacing: -.065em; }
h2 { font-size: 1.13rem; letter-spacing: -.035em; }
.skip { position: fixed; left: 1rem; top: -8rem; background: white; padding: .75rem; z-index: 10; }
.skip:focus { top: 1rem; }
.layout { display: grid; grid-template-columns: 228px minmax(0, 1fr); min-height: 100dvh; }
.rail { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; padding: 25px 18px; background: #fffdfb; border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; padding: 4px 8px; white-space: nowrap; }
.brand b { font: 700 1.16rem Georgia, serif; letter-spacing: .09em; display: block; }
.brand small { display: block; color: var(--muted); font-size: .79rem; margin-top: 2px; }
nav { margin-top: 37px; display: grid; gap: 6px; }
nav a { display: flex; align-items: center; gap: 12px; min-height: 49px; padding: 8px 14px; border-radius: 12px; text-decoration: none; font-weight: 650; font-size: .96rem; }
nav a span { font-family: system-ui, sans-serif; font-size: 1.4rem; line-height: 1; }
nav a:hover, nav a[aria-current] { background: var(--soft); }
.settings { align-self: start; margin-top: auto; }
.workspace { min-width: 0; }
.top { height: 78px; max-width: 1320px; margin: auto; padding: 0 clamp(18px, 4vw, 54px); display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: .95rem; }
.top button { display: none; }
main { max-width: 1320px; margin: auto; padding: 0 clamp(18px, 4vw, 54px) 24px; outline: 0; }
footer { max-width: 1320px; margin: auto; padding: 0 clamp(18px, 4vw, 54px) 28px; color: var(--muted); font-size: .82rem; }
footer span { margin-left: 8px; }
.hero { position: relative; overflow: hidden; display: flex; justify-content: space-between; align-items: center; min-height: 258px; padding: clamp(23px, 4.5vw, 55px); background: linear-gradient(109deg,#f0e0e4,#f3e8e2); border: 1px solid #e8d6d8; border-radius: 23px; }
.hero > div:first-child { z-index: 1; }
.hero-date { color: var(--muted); font-size: .91rem; font-weight: 700; margin-bottom: 10px; }
.hero h1 + p { margin-top: 12px; }
.hero-actions, .dialog-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 20px; }
.hero-art { position: absolute; width: 300px; height: 300px; right: 1%; display: grid; place-items: center; pointer-events: none; }
.hero-art i { position: absolute; border: 1px solid #91637028; width: 92%; height: 75%; border-radius: 50%; transform: rotate(-36deg); }
.hero-art i + i { transform: rotate(30deg); width: 82%; height: 91%; border-color: #a780693d; }
.hero-art img { width: 155px; border-radius: 44px; box-shadow: 0 15px 45px #63444d16; }
.primary, .secondary, .quiet, .danger, .chip, .file-label { min-height: 44px; border-radius: 10px; padding: 8px 14px; border: 1px solid transparent; font-weight: 700; font-size: .9rem; display: inline-flex; align-items: center; justify-content: center; gap: 5px; text-decoration: none; }
.primary { background: var(--rose); color: white; }
.primary:hover { background: var(--ink); }
.secondary, .file-label { background: white; border-color: var(--line); }
.secondary:hover, .quiet:hover, .file-label:hover { background: var(--soft); }
.quiet, .danger { background: transparent; }
.danger { color: #983848; border-color: #efd3d7; }
.danger:hover { background: #f8e5e8; }
.compact { padding-inline: 9px; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin: 17px 0; }
.metric { display: grid; align-content: start; gap: 7px; min-width: 0; padding: clamp(12px, 2vw, 21px); border: 1px solid var(--line); background: white; border-radius: 15px; box-shadow: var(--shadow); }
.metric span { font-size: .91rem; color: var(--muted); font-weight: 650; }
.metric strong { font-size: clamp(1.13rem, 2vw, 1.55rem); overflow-wrap: anywhere; line-height: 1.3; letter-spacing: -.045em; }
.metric small, .hint { color: var(--muted); font-size: .82rem; }
.panel { padding: clamp(15px, 2.2vw, 24px); border: 1px solid var(--line); border-radius: 17px; background: white; box-shadow: var(--shadow); min-width: 0; }
main > .panel, main > .columns, .detail > .panel { margin-bottom: 15px; }
.columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; align-items: start; }
.section-title { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.section-title a { font-size: .87rem; flex-shrink: 0; min-height: 44px; display: inline-flex; align-items: center; }
.next { color: var(--muted); font-size: .88rem; margin-bottom: 4px; }
.item { display: flex; gap: 11px; align-items: center; padding: 13px 0; border-top: 1px solid var(--line); }
.item-main { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.item p { color: var(--muted); font-size: .86rem; margin-top: 3px; }
.item-side { display: grid; justify-items: end; min-width: 0; max-width: 39%; text-align: right; overflow-wrap: anywhere; }
.item-side b { font-size: .93rem; }
.glyph { flex: 0 0 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; color: var(--ink); background: var(--soft); font-weight: 700; }
.tags { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 6px; }
.pill { border-radius: 999px; background: var(--ivory); color: var(--muted); padding: 2px 8px; font-size: .77rem; font-weight: 700; }
.done { background: #e2eee8; color: #355b4a; }
.solemn { background: #ece9f0; color: #584e67; }
.chip { background: var(--ivory); }
.empty { color: var(--muted); border: 1px dashed var(--line); border-radius: 11px; padding: 20px 12px; text-align: center; margin: 8px 0; }
.shortcuts { display: flex; flex-wrap: wrap; gap: 10px; }
.shortcuts a, .shortcuts button { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 13px; border: 1px solid var(--line); border-radius: 10px; background: white; font-size: .9rem; font-weight: 700; text-decoration: none; }
.ad-slot { min-height: 7px; }
.page-title { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: 6px 0 21px; }
.page-title p { color: var(--muted); margin-top: 8px; }
.page-title button { flex-shrink: 0; }
.calendar-layout { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
.calendar-head { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-bottom: 9px; }
.calendar-controls { display: flex; margin-left: auto; }
.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.weekday { text-align: center; color: var(--muted); font-size: .87rem; padding-bottom: .4rem; }
.day { display: grid; justify-items: center; align-content: center; gap: 3px; min-height: 59px; border: 1px solid var(--line); border-radius: 8px; background: white; padding: 2px; }
.day small { font-size: .75rem; }
.day.outside { color: var(--muted); background: var(--ivory); }
.day.today { border-color: var(--rose); font-weight: 750; }
.day.chosen { background: var(--soft); border-color: var(--rose); }
label { display: grid; gap: 5px; font-weight: 650; font-size: .9rem; min-width: 0; }
input, select, textarea { border: 1px solid #ccb9be; border-radius: 9px; min-height: 44px; padding: 8px 10px; width: 100%; min-width: 0; background: white; }
select { appearance: none; padding-right: 29px; background: linear-gradient(45deg,transparent 50%,var(--ink) 50%) calc(100% - 14px) 51% / 5px 5px no-repeat, linear-gradient(135deg,var(--ink) 50%,transparent 50%) calc(100% - 9px) 51% / 5px 5px no-repeat, white; }
textarea { resize: vertical; min-height: 80px; }
.search { margin-bottom: 14px; }
.filter-grid { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin-bottom: 16px; }
.filter-grid label { flex: 1 1 125px; }
.stats-select { max-width: 360px; }
.panel .metrics { margin-bottom: 0; }
.chart-row { display: grid; grid-template-columns: 38px minmax(0, 1fr); align-items: center; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: .87rem; }
.bar-line { display: flex; align-items: center; gap: 6px; min-height: 18px; }
.bar-line i { height: 7px; flex-shrink: 0; background: var(--rose); border-radius: 5px; }
.bar-line.received i { background: var(--sage); }
.bar-line small { font-size: .8rem; overflow-wrap: anywhere; line-height: 1.2; }
.legend { display: flex; gap: 16px; margin: 8px 0; font-size: .86rem; }
.legend span + span { color: #3c634f; }
.breakdown { margin: 0; padding: 0; list-style: none; }
.breakdown li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
dialog { width: min(680px, calc(100% - 20px)); max-height: calc(100dvh - 24px); border: 1px solid var(--line); border-radius: 18px; padding: 0; color: var(--ink); background: white; box-shadow: 0 24px 90px #39222c4d; }
dialog::backdrop { background: #3a252c66; }
.dialog-head { position: sticky; top: 0; z-index: 2; background: white; border-bottom: 1px solid var(--line); padding: 8px 18px; display: flex; align-items: center; justify-content: space-between; }
.dialog-head button { font-size: 1.3rem; }
.dialog-notice:not(:empty) { margin: 10px 18px 0; padding: 8px 12px; border-radius: 8px; background: var(--soft); }
.editor, .detail { padding: 16px 18px 20px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; gap: 11px; }
.wide { grid-column: 1 / -1; }
.check { display: flex; min-height: 44px; align-items: center; }
.check input { width: 20px; min-height: 20px; accent-color: var(--rose); }
.form-error { color: #99354a; font-weight: 700; margin-top: 8px; }
.form-error:empty { display: none; }
.detail .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.detail > p + p { margin-top: 8px; }
.note { white-space: pre-wrap; overflow-wrap: anywhere; }
.settings-content .form-grid { margin: 20px 0; }
.file-label { position: relative; overflow: hidden; cursor: pointer; }
.file-label:focus-within { outline: 3px solid var(--rose); outline-offset: 3px; }
.file-label input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.banner { border-radius: 10px; padding: 9px 12px; background: #f3e6e6; font-size: .9rem; margin-bottom: 10px; }
#notice:not(:empty) { position: fixed; z-index: 4; left: 50%; bottom: 22px; transform: translateX(-50%); width: max-content; max-width: calc(100% - 30px); padding: 11px 17px; border-radius: 10px; background: var(--ink); color: white; box-shadow: var(--shadow); }
@media (max-width: 1050px) {
  .layout { grid-template-columns: 180px minmax(0, 1fr); }
  .rail { padding-inline: 12px; }
  .calendar-layout { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  .layout { display: block; }
  .rail { position: static; height: auto; padding: 13px 14px 6px; border: 0; background: var(--ivory); }
  .rail nav { position: fixed; z-index: 3; margin-top: 0; inset: auto 0 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; padding: 5px 5px calc(5px + env(safe-area-inset-bottom)); background: #fffdfb; border-top: 1px solid var(--line); }
  nav a { justify-content: center; flex-direction: column; gap: 4px; padding: 5px 1px; font-size: .78rem; line-height: 1.15; text-align: center; }
  .settings { display: none; }
  .top { height: auto; min-height: 48px; gap: 5px; font-size: .84rem; }
  .top button { display: inline-flex; white-space: nowrap; }
  .hero { min-height: 225px; }
  footer { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
  #notice:not(:empty) { bottom: calc(68px + env(safe-area-inset-bottom)); }
}
@media (max-width: 635px) {
  .columns { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .hero-art { right: -64px; opacity: .30; transform: scale(.8); }
  .page-title { align-items: flex-start; flex-direction: column; }
  .day { min-height: 49px; }
}
@media (max-width: 370px) {
  .item { gap: 6px; }
  .glyph { flex-basis: 29px; height: 32px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
}
