@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;
  --soft: #f0f4ed;
  --danger: #ac4d43;
}
* { box-sizing: border-box; }
body { margin: 0; -webkit-font-smoothing: antialiased; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button, a, input, textarea { -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: wait; opacity: .55; }
input:disabled, textarea:disabled { opacity: .6; }
button, a { touch-action: manipulation; }
button, input, textarea { outline-offset: 4px; }
:focus-visible { outline: 3px solid #76ab96; outline-offset: 4px; }
button { border: 0; }
svg { flex-shrink: 0; }
button svg { pointer-events: none; }
[hidden] { display: none !important; }
.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; }
.app-header { background: rgba(255,255,255,.72); border-bottom: 1px solid var(--line); }
.header-inner { max-width: 1148px; margin: auto; min-height: 72px; padding: 15px 30px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: inline-flex; gap: 12px; 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; box-shadow: 0 3px 7px #286b5716; }
.brand-mark svg { height: 23px; width: 23px; }
.storage-badge { font-size: 11px; font-weight: 500; 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-text）には当てない。 */
.storage-badge > span:first-child { width: 6px; height: 6px; border-radius: 50%; background: #7ca483; flex-shrink: 0; }
.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); font-size: 12px; }
.role-badge { font-size: 11px; color: #6a5b2f; background: #f7f1df; border: 1px solid #e8dcb6; border-radius: 20px; padding: 4px 9px; white-space: nowrap; }
.view-only-note { font-size: 12px; line-height: 1.7; color: #6a5b2f; background: #f7f1df; border: 1px solid #e8dcb6; border-radius: 8px; padding: 9px 12px; margin: 8px 0 0; }
/* ログイン画面 */
.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-card .field { margin: 18px 0 0; }
.login-card input { display: block; width: 100%; min-height: 44px; border: 1px solid #dce3d8; border-radius: 8px; background: #fdfefa; padding: 9px 12px; font-size: 15px; color: var(--ink); }
.login-card input:focus { border-color: #7ba38f; box-shadow: 0 0 0 3px #286b5710; outline: none; }
.login-button { width: 100%; margin-top: 22px; min-height: 46px; font-size: 14px; }
.login-button:disabled { opacity: .6; }
.app-main { max-width: 1148px; margin: 0 auto; padding: 32px 30px 24px; }
.intro { display: flex; justify-content: space-between; align-items: center; gap: 25px; margin-bottom: 26px; }
.today { margin: 0 0 10px; font-size: 12px; letter-spacing: .06em; color: var(--muted); font-weight: 500; }
h1 { margin: 0; font-size: 30px; line-height: 1.5; letter-spacing: .045em; font-weight: 700; }
.intro-description { margin: 10px 0 0; color: var(--muted); font-size: 12px; line-height: 1.8; }
.summary { display: flex; align-items: center; padding-top: 17px; }
.summary-item { min-width: 96px; padding: 0 23px; border-left: 1px solid #dfe5db; }
.summary-item:first-child { border-left: 0; }
.summary-label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 7px; letter-spacing: .03em; }
.summary-item strong { font-size: 27px; line-height: 1.3; font-weight: 600; font-variant-numeric: tabular-nums; }
.summary-unit { font-size: 11px; color: #677367; margin-left: 5px; }
.workspace { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 25px; align-items: start; }
.panel { border: 1px solid #e4e9df; background: #fff; border-radius: 16px; box-shadow: 0 5px 22px #203c2b03; }
.composer { padding: 23px 25px 21px; }
.section-eyebrow { color: #5a755f; font-size: 11px; font-weight: 600; letter-spacing: .14em; margin-bottom: 8px; display: flex; align-items: center; gap: 7px; }
.small-plus { background: #edf3e8; color: #72916f; width: 17px; height: 17px; display: grid; place-items: center; font-size: 13px; border-radius: 5px; }
h2 { margin: 0; font-size: 17px; line-height: 1.6; font-weight: 650; letter-spacing: .025em; }
.composer-description { font-size: 12px; color: var(--muted); line-height: 1.7; margin: 6px 0 18px; }
.field { margin: 0 0 18px; }
.field label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; margin-bottom: 7px; }
.required-mark { font-size: 11px; line-height: 1.5; font-weight: 400; color: #64725f; background: #f1f4ed; padding: 1px 5px; border-radius: 3px; }
.optional-label { font-size: 12px; font-weight: 400; color: #697662; }
textarea, input[type="date"] { display: block; background: #fdfefa; width: 100%; border: 1px solid #dce3d8; border-radius: 8px; color: var(--ink); font-size: 14px; padding: 10px 12px; transition: border-color .15s, box-shadow .15s; }
textarea { height: 90px; min-height: 90px; max-height: 250px; resize: vertical; line-height: 1.75; }
textarea::placeholder { color: #6d7965; font-size: 12px; }
textarea:focus, input[type="date"]:focus { border-color: #7ba38f; box-shadow: 0 0 0 3px #286b5710; }
input[type="date"] { min-width: 0; min-height: 44px; color-scheme: light; }
.field-hint { font-size: 11px; line-height: 1.65; color: #687562; margin: 6px 0 0; }
.primary-button, .secondary-button, .danger-button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 44px; border-radius: 8px; font-size: 13px; font-weight: 600; padding: 11px 17px; line-height: 1.5; transition: background-color .15s, transform .15s; }
.primary-button { background: var(--green); color: #fff; }
.primary-button:hover:not(:disabled) { background: #205b49; }
.primary-button:active:not(:disabled), .secondary-button:active:not(:disabled) { transform: translateY(1px); }
.add-button { width: 100%; margin-top: 1px; }
.add-button > span:first-child { font-size: 18px; font-weight: 400; }
.composer-note { display: flex; align-items: flex-start; gap: 8px; padding-top: 14px; border-top: 1px solid #edf0e9; margin-top: 18px; }
.composer-note svg { width: 16px; height: 16px; margin-top: 1px; color: #8e9c8c; }
.composer-note p { font-size: 11px; color: #687562; line-height: 1.7; margin: 0; }
.tasks-panel { min-height: 504px; overflow: hidden; }
.tasks-heading { padding: 25px 26px 20px; display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.tasks-heading h2 { font-size: 15px; }
.sort-label { display: flex; align-items: center; gap: 5px; font-size: 11px; color: #687562; white-space: nowrap; }
.sort-label svg { width: 15px; height: 15px; }
.filters { padding: 0 25px; display: flex; gap: 22px; border-bottom: 1px solid var(--line); }
.filter-button { padding: 0 2px 14px; background: transparent; color: #687562; border-bottom: 2px solid transparent; margin-bottom: -1px; font-size: 13px; display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.filter-button > span { background: #f2f4ef; border-radius: 5px; padding: 2px 5px; font-size: 11px; min-width: 19px; font-variant-numeric: tabular-nums; }
.filter-button.is-active { color: var(--green); border-bottom-color: var(--green); font-weight: 600; }
.filter-button.is-active > span { background: #eaf2e6; color: #4a7258; }
.filter-button:hover { color: var(--green); }
.list-content { min-height: 331px; }
.loading-message { min-height: 331px; display: flex; align-items: center; justify-content: center; gap: 9px; font-size: 12px; color: var(--muted); margin: 0; padding: 20px; }
.loading-dot { width: 7px; height: 7px; border-radius: 50%; background: #8da78c; animation: breathe 1.3s ease-in-out infinite; }
.todo-list { list-style: none; padding: 0 25px; margin: 0; }
.todo-row { display: grid; grid-template-columns: 21px minmax(0,1fr) 28px; gap: 12px; align-items: start; padding: 19px 0 16px; border-bottom: 1px solid #edf0e9; }
.todo-row:last-child { border-bottom: none; }
.todo-checkbox { appearance: none; -webkit-appearance: none; width: 20px; height: 20px; margin: 3px 0 0; border: 1.5px solid #cbd7c8; border-radius: 6px; background: #fff; cursor: pointer; display: grid; place-content: center; transition: background-color .15s, border-color .15s; }
.todo-checkbox:hover { border-color: #699479; background: #f0f5ec; }
.todo-checkbox:checked { background: #63936d; border-color: #63936d; }
.todo-checkbox:checked::after { content: ""; width: 9px; height: 5px; border: solid white; border-width: 0 0 2px 2px; transform: translateY(-1px) rotate(-45deg); }
.todo-checkbox:disabled { cursor: wait; }
.todo-title { margin: 0 0 8px; font-size: 14px; font-weight: 500; line-height: 1.8; overflow-wrap: anywhere; white-space: pre-wrap; }
.todo-row.is-completed .todo-title { color: #687562; text-decoration: line-through; text-decoration-color: #c6cfc1; }
.todo-metadata { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.due-button { display: inline-flex; align-items: center; gap: 5px; background: transparent; border: 1px solid transparent; color: #687562; border-radius: 5px; padding: 3px 4px 3px 0; font-size: 11px; line-height: 1.6; text-align: left; }
.due-button svg { width: 12px; height: 12px; }
.due-button:hover:not(:disabled) { color: var(--green); background: #f2f5ee; }
.due-button.is-today, .due-button.is-overdue { padding: 2px 7px; background: #fbf5e8; color: #846325; }
.due-button.is-overdue { background: #fcf0ec; color: #974a37; }
.todo-row.is-completed .due-button { color: #687562; background: transparent; }
.completed-label { font-size: 11px; color: #687562; }
.icon-button { display: grid; place-items: center; background: transparent; width: 28px; height: 30px; border-radius: 6px; margin-top: 0; color: #7b8773; }
.icon-button svg { width: 15px; height: 15px; }
.icon-button:hover:not(:disabled) { background: #fcf0ec; color: var(--danger); }
.empty-state { text-align: center; padding: 47px 25px 53px; }
.empty-illustration { width: 93px; height: 93px; border-radius: 50%; margin: 0 auto 21px; background: #f4f7ef; display: grid; place-items: center; color: #8ba183; }
.empty-illustration svg { height: 68px; width: 68px; }
.empty-state h3 { margin: 0 0 10px; font-size: 14px; font-weight: 600; color: #61755f; letter-spacing: .02em; line-height: 1.8; }
.empty-state p { color: #687562; font-size: 12px; line-height: 1.95; margin: 0; }
.list-footer { border-top: 1px solid var(--line); background: #fcfdfa; color: #687562; margin: 0; padding: 12px 25px; font-size: 11px; line-height: 1.8; }
.page-footer { text-align: center; color: #687562; font-size: 11px; letter-spacing: .025em; margin-top: 26px; padding-bottom: 10px; }
.footer-mark { font-size: 12px; color: #92a78a; margin-right: 4px; }
.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: 13px 18px; margin-bottom: 22px; }
.error-banner p { font-size: 12px; line-height: 1.8; margin: 0; }
.text-button { background: transparent; color: inherit; text-decoration: underline; text-underline-offset: 4px; font-size: 11px; flex-shrink: 0; padding: 5px 0; }
dialog { width: min(460px, 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; backdrop-filter: blur(2px); }
.dialog-content { padding: 29px; }
.dialog-content h2 { font-size: 16px; margin-bottom: 15px; }
.dialog-todo-title { font-size: 14px; line-height: 1.9; color: #60705f; margin: 0 0 15px; padding: 13px; border-radius: 8px; background: #f6f8f2; overflow-wrap: anywhere; white-space: pre-wrap; max-height: 190px; overflow-y: auto; }
.dialog-description { color: #687562; font-size: 12px; line-height: 1.8; margin: 0 0 25px; }
.dialog-actions { display: flex; gap: 9px; justify-content: flex-end; flex-wrap: wrap; }
.secondary-button { background: #f0f3ec; color: #6c7b67; }
.secondary-button:hover:not(:disabled) { background: #e8ede3; }
.danger-button { background: #ac5c4d; color: #fff; }
.danger-button:hover:not(:disabled) { background: #944b3d; }
#clear-date { margin-right: auto; padding-left: 10px; padding-right: 10px; background: transparent; font-size: 11px; text-decoration: underline; text-underline-offset: 4px; }
@keyframes breathe { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (max-width: 900px) {
  .workspace { grid-template-columns: 285px minmax(0,1fr); gap: 18px; }
  .summary-item { min-width: 75px; padding: 0 15px; }
  .composer { padding: 23px 21px 21px; }
  .filters { gap: 17px; padding: 0 21px; }
  .tasks-heading { padding: 24px 21px 20px; }
  .todo-list { padding: 0 21px; }
  .sort-label { font-size: 11px; }
}
@media (max-width: 720px) {
  .header-inner { min-height: 72px; padding: 16px 22px; }
  .brand { font-size: 15px; gap: 9px; }
  .brand-mark { width: 30px; height: 30px; border-radius: 9px; }
  .storage-badge { display: none; }
  .header-tools { gap: 8px; }
  .user-name { max-width: 110px; }
  .role-badge { font-size: 10px; padding: 3px 7px; }
  .role-badge, .logout-button { flex-shrink: 0; }
  .header-tools:has(.role-badge:not([hidden])) .user-name { max-width: 64px; }
  .login-card input { font-size: 16px; }
  .app-main { padding: 30px 22px 22px; }
  .intro { align-items: flex-start; flex-direction: column; gap: 23px; margin-bottom: 25px; }
  h1 { font-size: 26px; }
  .intro-description { font-size: 12px; margin-top: 8px; }
  .summary { width: 100%; padding: 0; }
  .summary-item { flex: 1; padding: 0 20px; }
  .summary-item:first-child { padding-left: 1px; }
  .summary-item strong { font-size: 25px; }
  .workspace { grid-template-columns: 1fr; gap: 20px; }
  .composer { padding: 23px; }
  .composer-description { margin-bottom: 20px; }
  textarea, input[type="date"] { font-size: 16px; }
  textarea { height: 100px; min-height: 100px; }
  textarea::placeholder { font-size: 13px; }
  .field { margin-bottom: 18px; }
  .composer-note { margin-top: 18px; padding-top: 15px; }
  .tasks-panel { min-height: 400px; }
  .list-content, .loading-message { min-height: 280px; }
  .tasks-heading { padding: 22px 23px 21px; }
  .filters { padding: 0 23px; gap: 24px; }
  .todo-list { padding: 0 23px; }
  .empty-state { padding-top: 35px; padding-bottom: 38px; }
  .empty-illustration { margin-bottom: 18px; }
  .error-banner { align-items: flex-start; }
}
@media (max-width: 380px) {
  .header-inner { padding-left: 16px; padding-right: 16px; gap: 8px; }
  .brand { font-size: 13px; }
  .brand-mark { width: 27px; height: 27px; }
  .storage-badge { font-size: 11px; padding: 6px 7px; }
  .app-main { padding-left: 16px; padding-right: 16px; }
  .composer, .tasks-heading { padding-left: 19px; padding-right: 19px; }
  .todo-list, .filters { padding-left: 19px; padding-right: 19px; }
  .filters { gap: 18px; }
  .dialog-content { padding: 23px; }
}
