@charset "UTF-8";

:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  color: #233b36;
  background: #f6f7f3;
  font-synthesis: none;
  --ink: #233b36;
  --muted: #647368;
  --green: #286b57;
  --line: #e7ebe4;
  --sunday: #b23f36;
  --saturday: #2b5f94;
  --meal: #b4621f;
  --place: #23806b;
  --stay: #5b55a6;
}
* { box-sizing: border-box; }
body { margin: 0; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; }
button, a, input, select { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button:disabled, select:disabled { cursor: wait; }
:focus-visible { outline: 3px solid #76ab96; outline-offset: 2px; }
svg { flex-shrink: 0; }
[hidden] { display: none !important; }
.icon-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 10; left: 16px; top: -70px; padding: 12px 20px; background: var(--green); color: white; border-radius: 8px; }
.skip-link:focus { top: 12px; }
.kind-meal { --kind: var(--meal); }
.kind-place { --kind: var(--place); }
.kind-stay { --kind: var(--stay); }

.app-header { background: rgba(255,255,255,.72); border-bottom: 1px solid var(--line); }
.header-inner { max-width: 1180px; margin: auto; min-height: 68px; padding: 14px 30px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; gap: 11px; align-items: center; text-decoration: none; color: var(--ink); font-size: 17px; font-weight: 700; letter-spacing: .035em; }
.brand-mark { height: 34px; width: 34px; display: grid; place-items: center; color: white; background: var(--green); border-radius: 10px; }
.brand-mark svg { height: 21px; width: 21px; }
.storage-badge { font-size: 11px; color: #5e7164; display: inline-flex; align-items: center; gap: 7px; border: 1px solid #e0e7dd; border-radius: 20px; padding: 7px 11px; background: #fbfcf9; white-space: nowrap; }
.storage-badge > span { width: 6px; height: 6px; border-radius: 50%; background: #7ca483; }

.app-main { max-width: 1180px; margin: 0 auto; padding: 26px 30px 24px; }
.month-bar { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; flex-wrap: wrap; margin-bottom: 14px; }
.today { margin: 0 0 6px; font-size: 12px; letter-spacing: .04em; color: var(--muted); }
h1 { margin: 0; font-size: 28px; line-height: 1.4; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.month-controls { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.nav-button { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 8px; background: #fff; border: 1px solid #dce3d8; color: var(--ink); }
.nav-button svg { width: 18px; height: 18px; }
.nav-button:hover:not(:disabled) { background: #f0f4ed; }
.nav-button:disabled { opacity: .35; cursor: default; }
select { height: 40px; border: 1px solid #dce3d8; border-radius: 8px; background: #fff; padding: 0 30px 0 12px; font-size: 14px; }
.secondary-button, .primary-button { display: inline-flex; justify-content: center; align-items: center; min-height: 40px; border-radius: 8px; font-size: 13px; font-weight: 600; padding: 9px 16px; line-height: 1.5; }
.secondary-button { background: #eaf0e6; color: #42614f; }
.secondary-button:hover:not(:disabled) { background: #e0e9db; }
.primary-button { background: var(--green); color: #fff; }
.primary-button:hover:not(:disabled) { background: #205b49; }
.today-button { margin-left: 4px; }

.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 14px; padding: 0; font-size: 12px; color: var(--muted); }
.legend li { display: inline-flex; align-items: center; gap: 5px; }
.legend svg { width: 16px; height: 16px; color: var(--kind); }

.error-banner { display: flex; align-items: center; justify-content: space-between; gap: 15px; border: 1px solid #edd9d3; background: #fff7f3; color: #a05443; border-radius: 10px; padding: 12px 18px; margin-bottom: 14px; }
.error-banner p { font-size: 13px; line-height: 1.8; margin: 0; }
.text-button { background: transparent; color: inherit; text-decoration: underline; text-underline-offset: 4px; font-size: 12px; flex-shrink: 0; padding: 5px 0; }

.panel { border: 1px solid #e4e9df; background: #fff; border-radius: 14px; }
.calendar { overflow: hidden; }
.weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.weekdays { border-bottom: 1px solid var(--line); background: #fbfcf9; }
.weekdays span { text-align: center; font-size: 12px; font-weight: 600; padding: 9px 0; color: var(--muted); }
.weekdays .is-sunday { color: var(--sunday); }
.weekdays .is-saturday { color: var(--saturday); }
.day-cell { display: flex; flex-direction: column; align-items: stretch; gap: 3px; min-width: 0; min-height: 112px; padding: 6px 7px 8px; background: #fff; text-align: left; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); border-radius: 0; transition: background-color .12s; }
.day-cell:nth-child(7n) { border-right: 0; }
.day-cell:hover:not(:disabled) { background: #f6f9f3; }
.day-cell:focus-visible { outline-offset: -3px; position: relative; z-index: 1; }
.day-cell.is-other-month { background: #fafbf8; }
.day-cell.is-other-month .day-head, .day-cell.is-other-month .day-line { opacity: .45; }
.day-cell[data-outside="true"] { cursor: default; }
.day-head { display: flex; align-items: center; gap: 5px; min-width: 0; margin-bottom: 1px; }
.day-number { font-size: 13px; font-weight: 600; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.is-sunday .day-number, .is-sunday .holiday-name { color: var(--sunday); }
.is-saturday .day-number { color: var(--saturday); }
.day-cell.is-today .day-number { background: var(--green); color: #fff; }
.holiday-name { font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.day-line { display: flex; align-items: center; gap: 4px; min-width: 0; height: 19px; font-size: 12px; line-height: 19px; }
.day-line svg { width: 14px; height: 14px; color: #c9d1c5; }
.day-line.is-filled svg { color: var(--kind); }
.line-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

.month-list { margin-top: 18px; padding: 18px 20px; display: none; }
.month-list h2 { font-size: 15px; margin: 0 0 8px; }
.month-list ul { list-style: none; margin: 0; padding: 0; }
.month-list li + li { border-top: 1px solid var(--line); }
.month-list-item { width: 100%; display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 10px; text-align: left; background: transparent; padding: 11px 2px; border-radius: 6px; }
.month-list-item:hover:not(:disabled) { background: #f6f9f3; }
.month-list-date { font-size: 13px; font-weight: 600; padding-top: 1px; }
.month-list-date.is-sunday { color: var(--sunday); }
.month-list-date.is-saturday { color: var(--saturday); }
.month-list-lines { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.month-list-line { display: flex; align-items: flex-start; gap: 6px; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.month-list-line svg { width: 16px; height: 16px; margin-top: 2px; color: var(--kind); }
.month-list-empty { font-size: 13px; color: var(--muted); margin: 6px 0 2px; }
.page-footer { text-align: center; color: #687562; font-size: 11px; margin-top: 20px; padding-bottom: 10px; }

dialog { width: min(480px, calc(100% - 32px)); padding: 0; border: 1px solid var(--line); border-radius: 16px; color: var(--ink); background: #fff; box-shadow: 0 24px 90px #233b3626; }
dialog::backdrop { background: #17352c55; }
.dialog-content { padding: 26px; }
.dialog-content h2 { font-size: 18px; margin: 0 0 4px; }
.dialog-holiday { margin: 0; color: var(--sunday); font-size: 13px; }
.field { margin: 18px 0 0; }
.field label { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field label svg { width: 20px; height: 20px; color: var(--kind); }
.field input { display: block; width: 100%; min-height: 44px; border: 1px solid #dce3d8; border-radius: 8px; background: #fdfefa; padding: 9px 12px; font-size: 15px; }
.field input:focus { border-color: #7ba38f; box-shadow: 0 0 0 3px #286b5714; outline: none; }
.field input::placeholder { color: #8a9686; }
.field-hint { font-size: 11px; color: #687562; margin: 12px 0 20px; line-height: 1.7; }
.dialog-actions { display: flex; gap: 9px; justify-content: flex-end; }

.header-tools { display: flex; align-items: center; gap: 12px; min-width: 0; }
.user-name { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }
.logout-button { color: var(--muted); }

.login-page { min-height: 100vh; display: grid; place-items: center; background: #f6f7f3; }
.login-main { width: 100%; padding: 24px 16px; }
.login-card { max-width: 400px; margin: 0 auto; padding: 30px 28px 28px; }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.login-brand h1 { font-size: 22px; }
.login-description { font-size: 13px; color: var(--muted); line-height: 1.8; margin: 0 0 4px; }
.login-error { margin: 14px 0 0; padding: 10px 14px; border: 1px solid #edd9d3; background: #fff7f3; color: #a05443; border-radius: 8px; font-size: 13px; line-height: 1.7; }
.login-button { width: 100%; margin-top: 22px; min-height: 46px; font-size: 14px; }
.login-button:disabled { opacity: .6; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
@media (max-width: 760px) {
  .header-inner { padding: 12px 16px; min-height: 60px; }
  .brand { font-size: 15px; }
  .brand-mark { width: 30px; height: 30px; }
  .header-tools { gap: 8px; }
  .storage-badge { display: none; }
  .user-name { max-width: 110px; }
  .app-main { padding: 18px 16px 20px; }
  .month-bar { align-items: flex-start; flex-direction: column; gap: 10px; }
  h1 { font-size: 23px; }
  .month-controls { width: 100%; }
  .month-controls select { flex: 1; min-width: 0; padding: 0 22px 0 8px; }
  .today-button { margin-left: 0; padding: 9px 12px; }
  .legend { font-size: 11px; gap: 4px 12px; }
  .weekdays span { font-size: 11px; padding: 6px 0; }
  .day-cell { min-height: 74px; padding: 4px 2px 5px; gap: 2px; align-items: center; }
  .day-head { justify-content: center; }
  .day-number { font-size: 12px; width: 22px; height: 22px; }
  .holiday-name, .line-text { display: none; }
  .day-line { height: 14px; justify-content: center; }
  .day-line svg { width: 13px; height: 13px; color: transparent; }
  .day-line.is-filled svg { color: var(--kind); }
  .month-list { display: block; }
  .field input { font-size: 16px; }
  .dialog-content { padding: 22px 20px; }
}
