:root {
  --bg: #f1ece2;
  --panel: #f7f3ec;
  --card: #ffffff;
  --card-2: #fbf7ef;
  --ink: #2a2520;
  --ink-2: #5c544a;
  --muted: #847a6e;
  --line: #e5ddce;
  --line-2: #eee7d8;
  --accent: #c5613d;
  --accent-soft: #f5e0d5;
  --olive: #7a8158;
  --olive-soft: #e4e5d2;
  --gold: #b58a3a;
  --blue: #4f6e91;
  --plum: #8c5a7a;
  --warn: #b04c31;
  --gap: #f3dfd7;
  --shadow: 0 1px 0 rgba(53, 40, 28, 0.04), 0 8px 24px -12px rgba(53, 40, 28, 0.12);
  --radius: 14px;
  --radius-sm: 10px;
}

html {
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  min-height: 100vh;
  color: var(--ink);
  font-family: "Noto Sans JP", system-ui, sans-serif;
  background: var(--bg);
}

button, input, select, textarea { font: inherit; }

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
}

.app.auth-pending .toolbar-account {
  visibility: hidden;
}

.app.unauthenticated .sidebar > * {
  visibility: hidden;
}

.app.unauthenticated .toolbar {
  justify-content: flex-end;
}

.sidebar {
  width: 220px;
  min-width: 220px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.sidebar-header {
  padding: 18px 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: "Inter Tight", sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.4px;
}

.brand-copy {
  min-width: 0;
}

.sidebar-header .title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.sidebar-header .label {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--muted);
}

.sidebar-nav {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.sidebar-nav-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-nav-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}

.sidebar-nav-item.active {
  background: var(--card);
  border-color: var(--line);
  box-shadow: 0 1px 0 rgba(53, 40, 28, 0.03);
  color: var(--ink);
  font-weight: 600;
}

.sidebar-nav-item:disabled,
.sidebar-nav-item.nav-disabled {
  opacity: 0.56;
  cursor: default;
}

.sidebar-nav-icon {
  width: 18px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.sidebar-nav-item.active .sidebar-nav-icon {
  color: var(--accent);
}

.sidebar-mode-switch {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: var(--card-2);
  margin: 4px 8px 0;
}

.staff-list { padding: 0 8px 12px; flex: 1; }

.staff-section-label {
  font-size: 10px;
  color: var(--muted);
  padding: 0 8px;
  margin-bottom: 8px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  font-weight: 600;
}

.staff-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 2px;
  background: transparent;
  text-align: left;
  transition: background 0.15s, border-color 0.15s;
}

.staff-item:hover { background: rgba(255, 255, 255, 0.6); }

.staff-item.active {
  background: var(--card);
  border-color: var(--line);
  box-shadow: 0 1px 0 rgba(53, 40, 28, 0.03);
}

.staff-item .avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.8);
}

.staff-item .name {
  font-size: 13px;
  color: var(--ink-2);
}

.staff-item.active .name { color: var(--ink); }

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--line);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 0 14px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.sidebar-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  box-shadow: 0 0 0 1px var(--line);
}

.sidebar-user-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
}

.sidebar-user-team {
  font-size: 10.5px;
  color: var(--muted);
}

.sidebar-note {
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
}

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.hidden { display: none !important; }

.toolbar {
  padding: 18px 28px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.toolbar-tabs {
  display: none;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.toolbar-account {
  margin-left: auto;
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
}

.toolbar-heading {
  display: grid;
  gap: 2px;
  margin-right: 10px;
}

.toolbar-heading.is-empty {
  display: none;
}

.toolbar-subtitle {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.toolbar-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
}

.guest-login-btn {
  white-space: nowrap;
}

.account-btn {
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.account-avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

.account-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 220px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  display: none;
  z-index: 20;
}

.account-menu.open {
  display: grid;
  gap: 10px;
}

.account-menu-name {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.6;
  color: var(--ink);
}

.account-menu-action,
.account-logout {
  width: 100%;
  justify-content: center;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(42, 37, 32, 0.22);
}

.modal-card {
  width: min(480px, calc(100vw - 40px));
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  display: grid;
  gap: 16px;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.modal-close-btn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink-2);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.modal-body {
  display: grid;
  gap: 14px;
}

.weekday-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.weekday-option {
  position: relative;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #cfd7e5;
  border-radius: 999px;
  background: var(--card);
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease, color 0.16s ease;
}

.weekday-option input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

.weekday-option-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
}

.weekday-option:hover {
  border-color: #d4b191;
  box-shadow: 0 0 0 4px rgba(197, 97, 61, 0.08);
}

.weekday-option.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 4px rgba(197, 97, 61, 0.12);
}

.weekday-option.is-selected .weekday-option-text {
  color: var(--accent);
}

.weekday-option:has(input:focus-visible) {
  outline: none;
  box-shadow: 0 0 0 4px rgba(197, 97, 61, 0.16);
}

.view-toggle {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: var(--panel);
}

.view-toggle-secondary {
  border-style: dashed;
  background: var(--card-2);
}

.view-toggle button {
  padding: 7px 16px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  background: transparent;
  color: var(--ink-2);
  transition: all 0.15s;
  font-family: inherit;
}

.view-toggle button.active {
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 1px 0 rgba(53, 40, 28, 0.03);
}

.mode-btn {
  padding: 7px 16px;
  font-size: 12px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  background: transparent;
  color: var(--ink-2);
}

.mode-btn.active {
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 1px 0 rgba(53, 40, 28, 0.03);
}

.date-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.nav-arrow {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  color: var(--ink-2);
}

.nav-arrow:disabled {
  opacity: 0.4;
  cursor: default;
  background: var(--panel);
}

.date-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 14px;
  min-width: 172px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  color: var(--ink);
  background: var(--card);
  font-family: "Inter Tight", "Noto Sans JP", sans-serif;
  font-variant-numeric: tabular-nums;
}

.today-btn {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  font-size: 12px;
  color: var(--ink-2);
  cursor: pointer;
}

.date-nav.soft-controls .nav-arrow,
.date-nav.soft-controls .today-btn {
  opacity: 0.38;
  background: var(--panel);
}

.content {
  padding: 22px 28px 0;
  display: flex;
  gap: 20px;
  overflow: auto;
}

.panel .content:last-child {
  padding-bottom: 28px;
}

.summary-layout { align-items: stretch; }

.column { flex: 1; min-width: 0; }
.metric-column { flex: 0 0 220px; }

.metric-stack {
  display: grid;
  gap: 14px;
}

.metric-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

.metric-card.warn .metric-value { color: var(--warn); }

.metric-title {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
}

.metric-value {
  font-size: 30px;
  font-weight: 600;
  line-height: 1.05;
  font-family: "Inter Tight", "Noto Sans JP", sans-serif;
  font-variant-numeric: tabular-nums;
}

.metric-value.small { font-size: 28px; }
.metric-caption { font-size: 12px; color: var(--muted); margin-top: 8px; }

.column-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.column-dot { width: 8px; height: 8px; border-radius: 50%; }
.column-label { font-size: 13px; font-weight: 500; }

.report-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}

.report-card.today { border-color: var(--line); }

.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.card-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}

.card-name { font-size: 14px; font-weight: 600; color: var(--ink); }

.card-hours {
  font-size: 12px;
  color: var(--muted);
  margin-left: auto;
  font-family: "Inter Tight", "Noto Sans JP", sans-serif;
  font-variant-numeric: tabular-nums;
}

.summary-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-2);
  font-size: 13px;
}

.summary-row:last-child { border-bottom: none; }
.summary-task { flex: 1; color: var(--ink); }

.summary-hours {
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  min-width: 50px;
  text-align: right;
  font-family: "Inter Tight", "Noto Sans JP", sans-serif;
  font-variant-numeric: tabular-nums;
}

.summary-bar-wrap {
  width: 80px;
  height: 6px;
  background: var(--line-2);
  border-radius: 3px;
  overflow: hidden;
  flex-shrink: 0;
}

.summary-bar {
  height: 100%;
  border-radius: 3px;
  background: var(--accent);
}

.summary-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0 0;
  margin-top: 4px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}

.schedule-item {
  display: flex;
  gap: 10px;
  padding: 6px 0;
  font-size: 13px;
  line-height: 1.5;
}

.schedule-time {
  color: var(--muted);
  white-space: nowrap;
  min-width: 100px;
  font-family: "Inter Tight", "Noto Sans JP", sans-serif;
  font-variant-numeric: tabular-nums;
}

.schedule-desc { color: var(--ink); }

.report-text {
  white-space: pre-line;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--card-2);
  color: var(--ink);
  line-height: 1.8;
  font-family: inherit;
}

.report-editor {
  display: grid;
  gap: 18px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
}

.report-editor-head,
.report-editor-section {
  display: grid;
  gap: 6px;
}

.report-editor-line {
  font-size: 14px;
  line-height: 1.8;
  color: var(--ink);
  white-space: pre-line;
}

.report-result-list {
  display: grid;
  gap: 8px;
}

.report-result-item {
  display: grid;
  gap: 8px;
}

.report-result-parent {
  font-size: 14px;
  line-height: 1.8;
  color: var(--ink);
}

.report-result-toggle {
  border: none;
  background: transparent;
  padding: 0;
  text-align: left;
  font: inherit;
  color: var(--ink);
  line-height: 1.8;
  cursor: pointer;
}

.report-result-toggle-group {
  display: grid;
  gap: 2px;
  justify-items: start;
  width: 100%;
  cursor: default;
}

.report-result-subtask {
  font-size: 14px;
  line-height: 1.8;
  color: var(--ink);
  white-space: pre-line;
}

.report-result-detail-input {
  width: 100%;
  min-height: 92px;
  resize: vertical;
}

.report-result-detail-text {
  white-space: pre-line;
  font-size: 13px;
  line-height: 1.8;
  color: var(--muted);
  padding-left: 16px;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.report-note-section {
  gap: 10px;
}

.report-note-empty {
  display: flex;
}

.report-note-add {
  border: 1px dashed var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 14px;
  padding: 10px 12px;
  font: inherit;
  cursor: pointer;
  transition: border-color 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.report-note-add:hover {
  border-color: var(--accent);
  color: var(--ink);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent);
}

.report-note-text {
  padding-left: 0;
}

.report-note-input {
  min-height: 92px;
}

.report-detail-empty {
  padding-left: 16px;
}

.group-list {
  display: grid;
  gap: 16px;
}

.stack-list {
  display: grid;
  gap: 14px;
}

.member-stack-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card-2);
}

.member-stack-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.member-stack-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.member-stack-sub {
  font-size: 12px;
  color: var(--muted);
}

.timeline-member-row {
  margin-bottom: 16px;
}

.timeline-member-row:last-child {
  margin-bottom: 0;
}

.group-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

.group-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.group-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
}

.group-total {
  font-size: 24px;
  font-weight: 600;
  color: var(--ink);
  font-family: "Inter Tight", "Noto Sans JP", sans-serif;
  font-variant-numeric: tabular-nums;
}

.group-members {
  display: grid;
  gap: 10px;
}

.group-member-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px 70px;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line-2);
}

.group-member-row:first-child {
  border-top: none;
  padding-top: 0;
}

.group-member-name { font-size: 14px; color: var(--ink); }
.group-member-meta { font-size: 12px; color: var(--muted); }

.group-empty {
  padding: 24px;
  text-align: center;
  color: var(--muted);
  background: var(--card-2);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.timeline-shell { padding: 22px; }

.timeline-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}

.legend {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}

.legend span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--accent);
}

.day-scale {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 11px;
  font-family: "Inter Tight", "Noto Sans JP", sans-serif;
  font-variant-numeric: tabular-nums;
}

.day-bar {
  position: relative;
  height: 74px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background:
    repeating-linear-gradient(90deg, transparent 0, transparent calc(8.333% - 1px), rgba(42, 37, 32, 0.07) calc(8.333% - 1px), rgba(42, 37, 32, 0.07) 8.333%),
    var(--card-2);
}

.group-timeline-list {
  position: static;
  height: auto;
  border: none;
  border-radius: 0;
  overflow: visible;
  background: transparent;
}

.segment {
  position: absolute;
  top: 12px;
  height: 50px;
  display: grid;
  place-items: center;
  padding: 0 10px;
  border-radius: 10px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 10px 22px rgba(53, 40, 28, 0.15);
  box-sizing: border-box;
  border-left: 2px solid transparent;
  border-right: 2px solid transparent;
  background-clip: padding-box;
}

.segment.work { background: var(--olive); }
.segment.meeting { background: var(--blue); }
.segment.break { background: #b8ae9d; }

.segment.gap {
  color: var(--warn);
  background: repeating-linear-gradient(-45deg, var(--gap), var(--gap) 8px, #fbf3ef 8px, #fbf3ef 16px);
  box-shadow: none;
}

.timeline-compact-track {
  position: relative;
  height: 36px;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.timeline-compact-track .segment {
  top: 0;
  height: 100%;
  border-radius: 0;
  box-shadow: none;
  font-size: 11px;
  font-weight: 600;
  padding: 0;
  border-left-width: 0;
  border-right-width: 0;
}

.timeline-compact-track .segment.gap {
  color: transparent;
  font-size: 0;
}

.gap-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.gap-card {
  padding: 14px;
  border-radius: var(--radius);
  background: var(--card-2);
  border: 1px solid var(--line);
}

.gap-card strong {
  display: block;
  margin-bottom: 6px;
  color: var(--warn);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.quick-time-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 12px;
}

.quick-time-grid .field {
  width: max-content;
}

.quick-time-grid .time-choice-input,
.quick-time-grid select {
  width: 60px;
  min-width: 60px;
  height: 42px;
  padding: 11px 12px;
}

.quick-time-grid select {
  width: 118px;
  min-width: 118px;
}

#start-break,
#settings-break-duration {
  width: 100px;
  min-width: 100px;
}

.settings-time-grid {
  margin-bottom: 0;
}

.start-work-summary {
  width: fit-content;
  margin: 0 0 12px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card-2);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
}

#quick-form .field-grid {
  grid-template-columns: repeat(2, minmax(0, 220px));
  justify-content: start;
}

.field {
  position: relative;
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.time-choice-input {
  font-variant-numeric: tabular-nums;
}

.time-choice-list {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  width: 106px;
  max-height: 150px;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.time-choice-column {
  max-height: 140px;
  overflow: auto;
  display: grid;
  gap: 2px;
  scrollbar-width: thin;
  scrollbar-color: #a79d91 transparent;
}

.time-choice-column::-webkit-scrollbar {
  width: 5px;
}

.time-choice-column::-webkit-scrollbar-track {
  background: transparent;
}

.time-choice-column::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #a79d91;
}

.time-choice-option {
  border: 0;
  border-radius: 6px;
  padding: 3px 4px;
  background: transparent;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
  text-align: center;
  cursor: pointer;
}

.time-choice-option:hover,
.time-choice-option.active {
  background: var(--accent);
  color: #fff;
}

.suggest-field {
  position: relative;
}

.suggest-field input {
  padding-right: 38px;
}

.clear-field-btn {
  position: absolute;
  top: 50%;
  right: 10px;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
}

.clear-field-btn:disabled {
  color: #d8d0c3;
  cursor: not-allowed;
}

.suggest-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 20;
  display: none;
  max-height: 220px;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.suggest-list.open {
  display: grid;
  gap: 4px;
}

.suggest-option {
  border: 0;
  border-radius: 8px;
  padding: 9px 10px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.suggest-option:hover {
  background: var(--card-2);
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  background: var(--card);
  color: var(--ink);
  outline: none;
}

input::placeholder,
textarea::placeholder {
  color: var(--muted);
}

input:disabled,
select:disabled,
textarea:disabled {
  background: var(--card-2);
  color: var(--muted);
  border-color: var(--line);
  cursor: not-allowed;
}

input:disabled::placeholder,
textarea:disabled::placeholder {
  color: var(--muted);
}

.field-static {
  width: 100%;
  min-height: 22px;
  display: flex;
  align-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}

textarea {
  min-height: 112px;
  resize: vertical;
  line-height: 1.7;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(197, 97, 61, 0.12);
}

.primary-btn {
  border: 0;
  border-radius: 10px;
  padding: 12px 16px;
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.ghost-btn {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 16px;
  background: var(--card);
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
}

.ghost-btn-sm {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.input-stack {
  display: grid;
  gap: 14px;
}

.entry-page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.95fr);
  gap: 18px;
  align-items: start;
}

.entry-main-stack,
.entry-taskmaster-stack {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.entry-switch {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.entry-switch-btn {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  background: var(--card-2);
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
}

.entry-switch-btn.active {
  background: var(--card);
  color: var(--ink);
  border-color: var(--line);
  box-shadow: 0 1px 0 rgba(53, 40, 28, 0.03);
}

.entry-tab-panel {
  display: none;
  gap: 14px;
}

.entry-tab-panel.active {
  display: grid;
}

.entry-block {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}

.timestamp-main {
  border-color: var(--line);
  box-shadow: var(--shadow);
}

.entry-block-head {
  margin-bottom: 12px;
}

.entry-block-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.entry-start-wrap {
  margin-top: 0;
}

.entry-start-summary {
  display: block;
  cursor: pointer;
  list-style: none;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.entry-start-summary::-webkit-details-marker {
  display: none;
}

.entry-start-wrap[open] .entry-start-summary {
  margin-bottom: 12px;
}

.entry-start-wrap .entry-start-panel {
  display: none;
}

.entry-start-wrap[open] .entry-start-panel {
  display: block;
  margin-top: 0;
}

.entry-block-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}

.entry-block-note {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}

.checklist-wrap {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 12px;
}

.checklist-block {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card-2);
}

.checklist-title {
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.checklist-list {
  display: grid;
  gap: 8px;
}

.check-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  cursor: pointer;
}

.check-item input {
  width: auto;
  margin-top: 3px;
}

.check-item-main {
  display: grid;
  gap: 3px;
}

.check-item-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.check-item-sub {
  font-size: 11px;
  color: var(--muted);
}

.task-plan-group {
  display: grid;
  gap: 8px;
}

.task-plan-parent {
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.task-master-head.task-plan-parent {
  margin-bottom: 0;
  align-items: center;
}

.task-master-category-card.no-subtasks .task-master-head {
  margin-bottom: 0;
  align-items: center;
}

.task-plan-children {
  gap: 6px;
}

.task-plan-child {
  cursor: pointer;
}

.task-plan-head-copy,
.task-plan-subtask-copy {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.task-plan-head-copy input,
.task-plan-subtask-copy input {
  width: 15px;
  min-width: 15px;
  height: 15px;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid #cfbfa6;
  border-radius: 5px;
  background: var(--card);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  cursor: pointer;
  position: relative;
  flex: 0 0 auto;
}

.task-plan-head-copy input:hover,
.task-plan-subtask-copy input:hover {
  border-color: #bd9b78;
  box-shadow: 0 0 0 4px rgba(197, 97, 61, 0.08);
}

.task-plan-head-copy input:active,
.task-plan-subtask-copy input:active {
  border-color: #bd9b78;
  box-shadow: 0 0 0 4px rgba(197, 97, 61, 0.08);
}

.task-plan-head-copy input:checked,
.task-plan-subtask-copy input:checked {
  background:
    center/15px 15px no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23c5613d' stroke-linecap='round' stroke-linejoin='round' stroke-width='2.2' d='M3.5 8.5 6.6 11.4 12.5 4.8'/%3E%3C/svg%3E"),
    var(--card);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.task-plan-head-copy input:checked:hover,
.task-plan-subtask-copy input:checked:hover {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 0 0 4px rgba(197, 97, 61, 0.08);
}

.task-plan-head-copy input:checked:active,
.task-plan-subtask-copy input:checked:active {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 0 0 4px rgba(197, 97, 61, 0.08);
}

.task-plan-head-copy input:focus,
.task-plan-subtask-copy input:focus {
  outline: none;
}

.task-plan-head-copy .task-master-title,
.task-plan-subtask-copy .task-master-subtask-title {
  min-width: 0;
}

.task-plan-head-copy .task-master-title,
.task-plan-subtask-copy .task-master-subtask-title {
  line-height: 1.45;
}

.teams-chat-select-hidden {
  display: none;
}

.chat-picker-trigger {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.chat-picker-trigger-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.chat-picker-summary-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card-2);
  color: var(--ink);
  font-size: 11.5px;
  line-height: 1.35;
}

.chat-picker-summary-chip.more {
  color: var(--muted);
}

.chat-picker-trigger-caret {
  color: var(--ink-2);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  flex: 0 0 auto;
}

.chat-picker-panel {
  display: none;
  position: absolute;
  top: calc(100% - 6px);
  left: 14px;
  right: 14px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  box-shadow: var(--shadow);
  z-index: 30;
}

.chat-picker-panel.open {
  display: block;
}

.chat-picker {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
}

.chat-picker-empty {
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: var(--card-2);
  color: var(--muted);
  font-size: 12px;
}

.chat-picker-item {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid #d9cfbd;
  background: #fcfaf5;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.chat-picker-item:hover {
  background: #f7f1e6;
}

.chat-picker-item:has(input:checked) {
  border-color: rgba(197, 97, 61, 0.55);
  background: var(--accent-soft);
}

.chat-picker-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.chat-picker-copy {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.chat-picker-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-picker-meta {
  font-size: 10.5px;
  color: var(--muted);
  flex: 0 0 auto;
}

.chat-picker-meta {
  font-size: 11px;
  color: var(--muted);
}

.task-master-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.task-category-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.task-category-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--card-2);
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink);
}

.task-category-delete {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 10px;
  color: var(--warn);
}

.task-master-mode {
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}

.task-bulk-wrap {
  margin-top: 14px;
  border-top: 1px dashed var(--line);
  padding-top: 14px;
}

.task-bulk-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  list-style: none;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}

.task-bulk-summary::-webkit-details-marker {
  display: none;
}

.task-bulk-summary::before {
  content: '+';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  flex: 0 0 12px;
}

.task-bulk-wrap[open] .task-bulk-summary::before {
  content: '-';
}

.task-bulk-form {
  margin-top: 14px;
}

.task-bulk-form textarea {
  min-height: 132px;
}

.task-bulk-note {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}

.task-master-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}

.task-master-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.task-master-meta {
  display: flex;
  gap: 8px;
  align-items: center;
}

.task-master-inline-edit {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.task-master-inline-edit-subtask {
  width: 100%;
}

.task-master-inline-input {
  min-width: 0;
  max-width: 360px;
}

.task-master-head-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.task-master-drag {
  position: relative;
  width: 16px;
  height: 22px;
  padding: 0;
  border: 0;
  background: transparent;
  color: transparent;
  cursor: grab;
  touch-action: none;
  flex: 0 0 auto;
  overflow: hidden;
  text-indent: -9999px;
}

.task-master-drag::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 3px;
  width: 3px;
  height: 3px;
  border-radius: 999px;
  background: #c9c1b5;
  box-shadow:
    0 6px 0 #c9c1b5,
    0 12px 0 #c9c1b5,
    6px 0 0 #c9c1b5,
    6px 6px 0 #c9c1b5,
    6px 12px 0 #c9c1b5;
}

.task-master-drag:active {
  cursor: grabbing;
}

.task-master-drag-subtask {
  width: 14px;
  height: 20px;
}

.task-master-subtask-copy {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.task-master-category-card.dragging,
.task-master-subtask-row.dragging {
  opacity: 0.55;
  box-shadow: 0 14px 28px rgba(53, 40, 28, 0.16);
  border-color: rgba(197, 97, 61, 0.4);
  pointer-events: none;
}

.drag-mirror {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 999;
  pointer-events: none;
  opacity: 0.9;
  transform-origin: top left;
  box-shadow: 0 18px 32px rgba(53, 40, 28, 0.2);
}

.task-master-edit,
.task-master-delete,
.task-category-delete {
  border: 1px solid var(--line);
  background: var(--card);
  cursor: pointer;
}

.task-master-edit {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
}

.task-master-delete {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  color: var(--warn);
}

.task-master-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.task-master-category {
  font-size: 11px;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 4px 8px;
}

.task-master-detail {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}

.task-master-subtasks {
  display: grid;
  gap: 8px;
}

.task-master-subtask-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: nowrap;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--card-2);
  border: 1px solid var(--line-2);
}

.task-master-subtask-copy {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}

.task-master-subtask-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  min-width: 0;
}

.task-master-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.task-master-empty {
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--card-2);
  border: 1px dashed var(--line);
  font-size: 12px;
  color: var(--muted);
}

.regular-meeting-section {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.regular-meeting-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
}

.regular-meeting-grid select {
  width: auto;
  min-width: 100px;
}

.regular-meeting-time-field {
  width: auto;
}

.regular-meeting-time-field input {
  width: 60px;
}

.regular-meeting-grid input[type="date"] {
  width: 132px;
  min-width: 132px;
}

.regular-meeting-title-field input {
  min-width: 220px;
}

.regular-meeting-weekday-field {
  flex-basis: 100%;
}

.weekday-toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 7px;
}

.weekday-toggle-row label {
  position: relative;
  display: inline-flex;
}

.weekday-toggle-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.weekday-toggle-row span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.weekday-toggle-row input:checked + span {
  border-color: var(--accent);
  background: rgba(197, 97, 61, 0.12);
  color: var(--accent);
}

.weekday-toggle-row input:focus-visible + span {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(197, 97, 61, 0.12);
}

.regular-meeting-import {
  margin-top: 10px;
}

.regular-meeting-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.regular-meeting-item,
.meeting-plan-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
}

.regular-meeting-title {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.regular-meeting-meta {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11.5px;
}

.meeting-plan-list {
  display: grid;
  gap: 8px;
}

.meeting-plan-row .meeting-time-input {
  width: 60px;
  min-width: 60px;
  height: 36px;
  padding: 8px 10px;
}

.meeting-time-sep {
  color: var(--muted);
  font-size: 12px;
}

.meeting-title-input {
  min-width: 0;
  height: 36px;
  padding: 8px 10px;
}

.mini-log {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.mini-log-item {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--card-2);
  border: 1px solid var(--line);
}

.mini-log-time {
  font-size: 11px;
  color: var(--ink-2);
  font-weight: 700;
}

.mini-log-text {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink);
}

.entry-day-scale {
  margin-bottom: 10px;
}

.entry-timeline-list {
  display: grid;
  gap: 12px;
}

.entry-timeline-list:empty {
  gap: 0;
}

.entry-timeline-track-shell {
  margin-bottom: 14px;
}

.entry-timeline-segment {
  cursor: default;
}

.entry-timeline-segment.break {
  background: #b8ae9d;
}

.entry-timeline-handle {
  position: absolute;
  top: 0;
  width: 14px;
  height: 100%;
  border: none;
  background: transparent;
  cursor: ew-resize;
  padding: 0;
}

.entry-timeline-handle::before {
  content: none;
}

.entry-timeline-handle.start {
  left: 0;
}

.entry-timeline-handle.start::before {
  left: 4px;
}

.entry-timeline-handle.end {
  right: 0;
}

.entry-timeline-handle.end::before {
  right: 4px;
}

.entry-timeline-boundary-handle {
  position: absolute;
  top: 0;
  width: 14px;
  height: 100%;
  border: none;
  background: transparent;
  cursor: ew-resize;
  padding: 0;
  z-index: 3;
}

.entry-timeline-boundary-handle::before {
  content: none;
}

.entry-timeline-segment.is-dragging {
  filter: brightness(1.04);
  box-shadow: 0 0 0 1px rgba(42, 37, 32, 0.08);
}

.entry-timeline-detail-stream .detail-row:last-child {
  border-bottom: none;
}

.auth-box {
  position: relative;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card-2);
}

.auth-box.alert-box {
  border-color: rgba(197, 97, 61, 0.35);
  background: #fbf0ea;
}

.alert-box-copy {
  display: grid;
  gap: 4px;
}

.alert-box-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--warn);
}

.alert-box-text {
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-2);
}

.auth-box-head {
  display: flex;
  justify-content: flex-start;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.auth-status,
.auth-note,
.storage-note {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

.preview {
  min-height: 360px;
  white-space: pre-line;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--card-2);
  color: var(--ink);
  line-height: 1.75;
  font-family: inherit;
}

.month-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.month-metric {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card-2);
}

.metric-label {
  font-size: 11px;
  color: var(--muted);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10;
  max-width: min(420px, calc(100vw - 36px));
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: var(--card);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.panel { display: none; }
.panel.active { display: block; }

.dashboard-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.stat-chip-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.stat-chip {
  padding: 14px 16px;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.stat-chip-label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.3px;
}

.stat-chip-value {
  margin-top: 2px;
  font-size: 24px;
  font-weight: 600;
  color: var(--ink);
  font-family: "Inter Tight", "Noto Sans JP", sans-serif;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.2px;
}

.stat-chip-sub {
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
}

.summary-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.summary-side-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 100%;
  min-width: 0;
}

.summary-side-stack > .section-card {
  flex: 1 1 0;
}

.section-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  height: 100%;
}

.section-card-wide {
  min-width: 0;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
}

.section-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.section-subtitle {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.section-head-note {
  font-size: 11px;
  color: var(--muted);
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--card-2);
  border: 1px solid var(--line);
}

.timeline-head.compact {
  margin-bottom: 10px;
}

.detail-stream {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 18px;
}

.detail-row {
  display: grid;
  grid-template-columns: 108px 8px minmax(0, 1fr) 70px;
  align-items: center;
  gap: 10px;
  padding: 8px 6px;
  border-bottom: 1px solid var(--line-2);
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-time,
.detail-hours,
.insight-value,
.group-admin-number {
  font-family: "Inter Tight", "Noto Sans JP", sans-serif;
  font-variant-numeric: tabular-nums;
}

.detail-time {
  font-size: 11.5px;
  color: var(--ink-2);
  font-weight: 600;
  white-space: nowrap;
}

.detail-time-range,
.detail-time-editor {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  white-space: nowrap;
}

.detail-time-piece {
  border: 0;
  background: transparent;
  padding: 0;
  border-radius: 4px;
  text-align: left;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, box-shadow 120ms ease;
  font: inherit;
  line-height: inherit;
  color: inherit;
}

.detail-time-piece:hover {
  box-shadow: 0 0 0 3px var(--accent-soft);
  color: var(--accent);
}

.detail-time-piece.is-open {
  box-shadow: 0 0 0 3px var(--accent-soft);
  color: var(--accent);
}

.detail-time-input-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.detail-time-input {
  width: 58px;
  min-width: 58px;
  height: 23px;
  padding: 1px 13px 1px 3px;
  border: 1px solid var(--focus);
  border-radius: 5px;
  background: var(--card);
  color: var(--ink-2);
  font-size: 11px;
  line-height: 1.2;
  font-family: "Inter Tight", "Noto Sans JP", sans-serif;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.detail-time-input::-webkit-calendar-picker-indicator {
  display: none;
  opacity: 0;
}

.detail-time-input::-webkit-inner-spin-button,
.detail-time-input::-webkit-clear-button {
  display: none;
}

.detail-time-picker-toggle {
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  width: 11px;
  height: 12px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}

.detail-time-picker-toggle:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.detail-time-picker {
  position: absolute;
  z-index: 20;
  left: 0;
  top: calc(100% + 4px);
  width: 78px;
  max-height: 190px;
  overflow: auto;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.detail-time-picker-option {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 11.5px;
  line-height: 1.4;
  padding: 3px 4px;
  text-align: center;
  cursor: pointer;
}

.detail-time-picker-option:hover,
.detail-time-picker-option.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.detail-time-sep {
  color: var(--ink-2);
  font-weight: 600;
}


.entry-timeline-detail-row {
  position: relative;
}

.entry-timeline-detail-row.has-time-popover {
  z-index: 2;
}

.timeline-time-popover {
  position: absolute;
  top: calc(100% - 2px);
  left: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.timeline-time-popover-input {
  width: 58px;
  min-width: 58px;
  padding: 6px 8px;
  font-size: 12px;
  line-height: 1.2;
  font-family: "Inter Tight", "Noto Sans JP", sans-serif;
  font-variant-numeric: tabular-nums;
}

.detail-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  justify-self: center;
}

.detail-dot-work { background: var(--accent); }
.detail-dot-meeting { background: var(--blue); }
.detail-dot-break { background: #b8ae9d; }

.detail-text {
  font-size: 13px;
  color: var(--ink);
}

.detail-hours {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  text-align: right;
}

.detail-empty {
  padding: 18px;
  border-radius: var(--radius-sm);
  background: var(--card-2);
  border: 1px dashed var(--line);
  color: var(--muted);
  font-size: 12px;
}

.insight-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-2);
}

.insight-row:last-child {
  border-bottom: none;
}

.insight-main {
  min-width: 0;
}

.insight-title {
  font-size: 13px;
  color: var(--ink);
  font-weight: 500;
}

.insight-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.insight-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
}

.group-admin-table {
  display: flex;
  flex-direction: column;
}

.group-admin-header,
.group-admin-row {
  display: grid;
  grid-template-columns: 1.2fr 90px 100px 1.8fr;
  gap: 12px;
  align-items: start;
}

.group-admin-header {
  padding: 0 0 12px;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.group-admin-row {
  padding: 16px 0;
  border-bottom: 1px solid var(--line-2);
}

.group-admin-row:last-child {
  border-bottom: none;
}

.group-admin-name {
  min-width: 0;
}

.group-admin-number {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}

.group-admin-members {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.group-admin-member {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--card-2);
  border: 1px solid var(--line);
}

.group-admin-member-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 4px;
}

.donut-card {
  display: flex;
  align-items: center;
  gap: 14px;
}

.donut {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.donut-hole {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: var(--card);
  display: grid;
  place-items: center;
  text-align: center;
}

.donut-value {
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
  font-family: "Inter Tight", "Noto Sans JP", sans-serif;
  font-variant-numeric: tabular-nums;
}

.donut-sub {
  font-size: 11px;
  color: var(--muted);
}

.donut-empty {
  padding: 18px;
  border-radius: var(--radius-sm);
  background: var(--card-2);
  border: 1px dashed var(--line);
  color: var(--muted);
  font-size: 12px;
}

.donut-legend {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.donut-legend-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.pill-mini {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.pill-mini i {
  width: 6px;
  height: 6px;
  border-radius: 999px;
}

.donut-legend-value {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  font-family: "Inter Tight", "Noto Sans JP", sans-serif;
  font-variant-numeric: tabular-nums;
}

.progress-list,
.insight-list,
.ranking-list,
.alert-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.progress-row-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
  font-size: 12.5px;
}

.progress-name {
  color: var(--ink);
  font-weight: 500;
}

.progress-value {
  color: var(--ink-2);
  font-weight: 600;
  font-family: "Inter Tight", "Noto Sans JP", sans-serif;
  font-variant-numeric: tabular-nums;
}

.progress-track {
  height: 5px;
  background: var(--line-2);
  border-radius: 99px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 99px;
}

.weekly-bars {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.weekly-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.weekly-bar-total,
.weekly-bar-date,
.calendar-hours,
.ranking-rank,
.ranking-value {
  font-family: "Inter Tight", "Noto Sans JP", sans-serif;
  font-variant-numeric: tabular-nums;
}

.weekly-bar-total {
  min-height: 14px;
  font-size: 10.5px;
  color: var(--ink-2);
  font-weight: 600;
}

.weekly-bar-track {
  width: 100%;
  height: 220px;
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-start;
  background: var(--card-2);
  border: 1px solid var(--line-2);
  border-radius: 8px 8px 0 0;
  overflow: hidden;
}

.weekly-bar-segment {
  width: 100%;
}

.weekly-bar-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-2);
}

.weekly-bar-date {
  font-size: 10px;
  color: var(--muted);
}

.heatmap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.heatmap-header,
.heatmap-row {
  display: grid;
  grid-template-columns: 24px repeat(11, 1fr);
  gap: 3px;
  align-items: center;
}

.heatmap-header {
  font-size: 9.5px;
  color: var(--muted);
  font-family: "Inter Tight", "Noto Sans JP", sans-serif;
  font-variant-numeric: tabular-nums;
}

.heatmap-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-2);
}

.heatmap-cell {
  aspect-ratio: 1;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.4);
}

.monthly-main-grid {
  grid-template-columns: 1.5fr 1fr;
}

.calendar-head {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  font-size: 10.5px;
  color: var(--muted);
  font-weight: 600;
  text-align: center;
  margin-bottom: 6px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.calendar-cell {
  aspect-ratio: 1.05;
  border-radius: 8px;
  border: 1px solid var(--line-2);
  padding: 6px 7px;
  display: flex;
  flex-direction: column;
  color: var(--ink-2);
}

.calendar-cell.empty {
  background: transparent;
  border-color: transparent;
}

.calendar-cell.today {
  border: 2px solid var(--accent);
}

.calendar-day {
  font-size: 11px;
  font-weight: 600;
  font-family: "Inter Tight", "Noto Sans JP", sans-serif;
  font-variant-numeric: tabular-nums;
}

.calendar-hours {
  margin-top: auto;
  font-size: 11px;
  font-weight: 600;
}

.ranking-row,
.alert-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-2);
}

.ranking-row:last-child,
.alert-row:last-child {
  border-bottom: none;
}

.ranking-rank {
  width: 18px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}

.ranking-main,
.alert-main {
  flex: 1;
  min-width: 0;
}

.ranking-name,
.alert-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
}

.ranking-sub,
.alert-name span,
.alert-issue {
  font-size: 11px;
  color: var(--muted);
}

.ranking-value {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
}

.alert-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  flex-shrink: 0;
}

.alert-dot.high { background: var(--accent); }
.alert-dot.mid { background: var(--gold); }
.alert-dot.low { background: var(--olive); }

@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { width: auto; min-width: 0; min-height: auto; }
  .summary-layout, .content { flex-direction: column; }
  .entry-page-grid { grid-template-columns: 1fr; }
  .metric-column { flex: 1 1 auto; }
  .gap-list, .month-metrics, .checklist-wrap { grid-template-columns: 1fr; }
  .stat-chip-grid,
  .summary-main-grid,
  .monthly-main-grid,
  .group-admin-header,
  .group-admin-row {
    grid-template-columns: 1fr;
  }
  .weekly-bars,
  .calendar-grid,
  .calendar-head {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .main { padding: 0; }
  .toolbar { padding: 14px 16px; }
  .content { padding: 18px 16px 0; }
  .sidebar-nav {
    padding-bottom: 10px;
  }
  .field-grid { grid-template-columns: 1fr; }
  #quick-form .field-grid {
    grid-template-columns: minmax(0, 220px);
    justify-content: start;
  }
  .regular-meeting-grid {
    grid-template-columns: repeat(3, max-content);
  }
  .regular-meeting-title-field {
    grid-column: 1 / -1;
  }
  .regular-meeting-title-field input {
    width: min(100%, 240px);
  }
  .meeting-plan-row {
    flex-wrap: wrap;
  }
  .meeting-title-input {
    flex: 1 1 160px;
  }
  .group-member-row { grid-template-columns: 1fr; }
  .auth-box-head { align-items: flex-start; flex-direction: column; }
  .toolbar-title { font-size: 18px; }
  .detail-row {
    grid-template-columns: 52px 8px minmax(0, 1fr);
  }
  .detail-hours {
    grid-column: 3;
    text-align: left;
    margin-left: 18px;
  }
  .donut-card {
    flex-direction: column;
    align-items: flex-start;
  }
  .heatmap-header,
  .heatmap-row {
    grid-template-columns: 20px repeat(11, 1fr);
  }
}
