:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --line: #e5e5ea;
  --accent: #1d1d1f;
  --danger: #8b3a3a;
  --radius-sm: 10px;
  --radius: 16px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", "PingFang HK", "PingFang TC", "Microsoft JhengHei", Arial, sans-serif;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  font-family: var(--font);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 15px;
  font-weight: var(--fw-regular);
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

h1, h2, h3 {
  font-family: var(--font);
  font-weight: var(--fw-semibold);
  letter-spacing: -0.02em;
  margin: 0;
}

[hidden] {
  display: none !important;
}

.page-center {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.25rem;
}

.login-shell {
  width: 100%;
  max-width: 380px;
}

.login-logo {
  margin-bottom: 2.5rem;
}

.login-logo img {
  display: block;
  height: 36px;
  width: auto;
  max-width: 200px;
}

.brand-mark {
  font-family: var(--font);
  font-size: 1.75rem;
  font-weight: var(--fw-semibold);
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
}

.brand-sub {
  color: var(--muted);
  font-size: 0.875rem;
  margin-bottom: 2.25rem;
}

.field {
  margin-bottom: 1.25rem;
}

.field label {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.45rem;
}

.field input,
.field select {
  padding: 0.7rem 0;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: none;
  border-bottom: 1.5px solid var(--line);
  border-radius: 0;
  background: transparent;
  font: inherit;
  color: var(--ink);
}

.field textarea {
  min-height: 72px;
  padding: 0.7rem 0;
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.field input:focus-visible,
.field textarea:focus-visible,
.field select:focus-visible {
  outline: none;
  box-shadow: none;
  border-bottom-color: var(--platform-field-focus, var(--ink));
  background: transparent;
}

.field:focus-within label {
  color: var(--ink);
}

.input-underline {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  border-bottom: 1.5px solid var(--line);
  transition: border-color 0.15s ease;
}

.input-underline:focus-within {
  border-bottom-color: var(--ink);
}

.field .input-underline input {
  flex: 1;
  min-width: 0;
  border: none;
  padding: 0.7rem 0;
}

.field .input-underline input:focus {
  border: none;
}

.login-eye {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
}

.login-eye:hover {
  color: var(--ink);
  background: rgba(20, 20, 20, 0.05);
}

.login-eye svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.login-form {
  display: flex;
  flex-direction: column;
}

.login-form .btn,
.login-actions {
  margin-top: 0.35rem;
  align-self: flex-start;
}

.login-form .btn:focus-visible,
.login-form a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.login-links {
  margin: 1rem 0 0;
  font-size: 0.875rem;
}

.login-links a {
  color: var(--muted);
}

.login-links a:hover {
  color: var(--ink);
}

.login-note {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.875rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 120px;
  min-height: 42px;
  padding: 0.7rem 1.5rem;
  border: 1px solid var(--ink);
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-weight: var(--fw-medium);
  letter-spacing: 0.02em;
  cursor: pointer;
}

.btn:hover {
  background: #000;
}

.btn:focus-visible,
.btn-ghost:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-ghost {
  width: auto;
  min-width: 0;
  min-height: 36px;
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
  padding: 0.45rem 0.9rem;
  font-size: 0.8125rem;
  border-radius: var(--radius-sm);
}

.btn-ghost:hover {
  border-color: var(--ink);
  background: transparent;
}

.btn-fab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-size: 22px;
  font-weight: var(--fw-regular);
  line-height: 1;
  cursor: pointer;
}

.btn-fab:hover {
  background: #000;
}

.btn-fab:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.btn-fab:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.error {
  color: var(--danger);
  font-size: 0.875rem;
  margin: 0 0 1rem;
  min-height: 1.25em;
}

.error.is-empty {
  visibility: hidden;
}

.topbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 2rem 2.5rem 0;
  max-width: 960px;
  margin: 0 auto;
}

.topbar-brand {
  font-family: var(--font);
  font-size: 1.25rem;
  font-weight: var(--fw-semibold);
  letter-spacing: -0.02em;
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.875rem;
}

.dash {
  /* Horizontal measure comes from .platform-page */
}

.dash-intro h1 {
  font-family: var(--font);
}

.dash-access {
  margin: 0 0 8px;
  padding-top: var(--platform-page-gap, 18px);
}

.dash-access ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dash-access li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-top: 1px solid var(--platform-line);
  font-size: 14px;
}

.dash-access a {
  color: var(--platform-ink);
}

.dash-access span,
.dash-access-empty {
  color: var(--platform-muted);
  font-size: 13px;
}

.dash-board {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 2.5rem 2.5rem;
  padding-top: var(--platform-page-gap, 18px);
  min-width: 0;
  align-items: start;
}

.dash-panel {
  min-width: 0;
}

.dash-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.2rem 0.75rem;
  margin: 0 0 0.35rem;
  min-width: 0;
}

.dash-panel-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
}

.dash-panel-icon:hover,
.dash-panel-icon:focus-visible {
  color: var(--ink);
  background: var(--platform-hover, rgba(29, 29, 31, 0.05));
  outline: none;
}

.dash-panel-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dash-panel-link {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.4;
  white-space: nowrap;
}

.dash-panel-link:hover {
  color: var(--ink);
}

.dash-date-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0 0 1.15rem;
}

.dash-date-chip {
  appearance: none;
  margin: 0;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.75rem;
  line-height: 1.2;
  min-height: 28px;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.dash-date-chip:hover {
  color: var(--ink);
}

.dash-date-chip.is-active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.dash-status {
  color: var(--muted);
  margin: 0;
  font-size: 0.875rem;
}

.dash-status.is-error {
  color: var(--danger);
}

.dash-empty {
  color: var(--muted);
  font-size: 0.875rem;
}

.dash-empty p {
  margin: 0;
}

.dash-empty-action {
  margin: 0.65rem 0 0;
}

.dash-day {
  margin: 0 0 1.75rem;
  min-width: 0;
  padding: 0;
  background: none;
  border: none;
}

.dash-day:last-child {
  margin-bottom: 0;
}

.dash-day-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  font-weight: var(--fw-medium);
  line-height: 1.4;
  color: var(--muted);
  margin: 0 0 0.7rem;
  letter-spacing: 0.04em;
}

.dash-day.is-today .dash-day-label {
  color: var(--ink);
  font-weight: var(--fw-semibold);
}

.dash-day.is-today .dash-day-label::after {
  content: '';
  width: 0.55rem;
  height: 1px;
  background: currentColor;
  opacity: 0.55;
}

.dash-day-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  align-items: start;
  justify-content: start;
}

.dash-day-grid > .apt-card {
  width: 100%;
  max-width: 420px;
  height: auto;
}

.dash-panel--reserve {
  --text: var(--ink, #1d1d1f);
  --text-secondary: var(--muted, #6e6e73);
  --text-muted: var(--platform-faint, #86868b);
  --border: var(--line, #e5e5ea);
  --border-strong: #d2d2d7;
  --bg-subtle: #f0f0f2;
  --hover: var(--platform-hover, rgba(29, 29, 31, 0.05));
  --attn-urgent: rgba(244, 63, 94, 0.55);
  --radius-xl: var(--radius, 16px);
  --radius-xs: 8px;
  --active-bg: #1d1d1f;
  --active-fg: #ffffff;
}

/* Dashboard already communicates the ten-day window through grouping/filtering.
   Keep canonical Reservation state classes and text, but suppress their borders here. */
.dash .dash-panel--reserve .dash-day-grid > .apt-card,
.dash .dash-panel--reserve .dash-day-grid > .apt-card:hover {
  border-color: transparent;
}

.dash-memo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  align-items: stretch;
}

.dash-card {
  min-width: 0;
}

.dash-memo-card {
  display: flex;
  flex-direction: column;
  min-height: 148px;
  padding: 14px 16px 16px;
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: var(--platform-radius, 16px);
  cursor: pointer;
}

.dash-memo-card:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.dash-card-title {
  font-size: 15px;
  font-weight: var(--fw-semibold);
  letter-spacing: -0.02em;
  line-height: 1.35;
  margin: 0;
  overflow-wrap: anywhere;
}

.dash-memo-card .dash-card-title {
  margin: 0 0 8px;
}

.dash-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.dash-memo-card .dash-note {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dash-memo-imgwrap {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: -4px -4px 10px;
  max-height: 220px;
  overflow: hidden;
  border-radius: 10px;
  background: var(--platform-hover, rgba(29, 29, 31, 0.05));
}

.dash-memo-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 220px;
  object-fit: cover;
  object-position: center;
}

.dash-icon-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  margin: 0;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
}

.dash-icon-btn:hover,
.dash-icon-btn:focus-visible {
  color: var(--ink);
  background: var(--platform-hover, rgba(29, 29, 31, 0.05));
  outline: none;
}

.dash-icon-btn:focus-visible {
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--ink);
}

.dash-icon-btn svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dash-icon-btn--complete {
  color: var(--ink);
}

.dash-icon-btn--complete:hover,
.dash-icon-btn--complete:focus-visible {
  background: var(--platform-hover, rgba(29, 29, 31, 0.06));
}

html.is-dash-preview-open,
html.is-dash-preview-open body {
  overflow: hidden;
}

.dash-preview {
  margin: auto;
  border: 1px solid var(--platform-line, var(--line));
  border-radius: var(--platform-radius-sm, 10px);
  padding: 0;
  background: var(--platform-surface, var(--surface));
  color: var(--platform-ink, var(--ink));
  max-width: 520px;
  width: calc(100% - 32px);
  max-height: min(88vh, 720px);
  overflow: hidden;
}

.dash-preview::backdrop {
  background: rgba(29, 29, 31, 0.28);
}

.dash-preview-inner {
  display: flex;
  flex-direction: column;
  max-height: min(88vh, 720px);
  min-width: 0;
}

.dash-preview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 8px 20px;
}

.dash-preview-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: var(--fw-semibold);
  letter-spacing: -0.02em;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.dash-preview-body {
  min-width: 0;
  overflow: auto;
  padding: 4px 20px 16px;
}

.dash-preview-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding: 8px 16px 16px;
}

.dash-preview-field {
  display: grid;
  gap: 2px;
  margin: 0 0 12px;
  min-width: 0;
}

.dash-preview-k {
  color: var(--muted);
  font-size: 12px;
}

.dash-preview-v {
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.dash-preview-v a {
  color: inherit;
}

.dash-preview-images {
  display: grid;
  gap: 10px;
  margin: 0 0 14px;
}

.dash-preview-img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  border-radius: 10px;
}

.dash-preview-note,
.dash-preview-memo-body {
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.dash-preview-foot .dash-icon-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
}

.dash-preview-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
}

@media (max-width: 899px) {
  .dash-board {
    grid-template-columns: minmax(0, 1fr);
    gap: 2.5rem;
  }

  .dash-icon-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
  }

  .dash-date-chip {
    min-height: 32px;
    padding: 0.25rem 0.6rem;
  }
}

@media (max-width: 480px) {
  .dash-day-grid,
  .dash-memo-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .dash-preview {
    width: calc(100% - 16px);
    max-width: none;
  }
}

.module-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.module-card {
  background: transparent;
  border: none;
  padding: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
}

.module-card h2 {
  font-family: var(--font);
  margin-bottom: 0.35rem;
}

.module-card .note {
  color: var(--muted);
  font-size: 0.875rem;
  margin: 0;
}

.module-status {
  flex-shrink: 0;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.9rem;
  white-space: nowrap;
}

a.module-status {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
  min-width: 72px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

a.module-status:hover {
  background: #000;
  color: #fff;
}

.module-card h2 a {
  text-decoration: none;
}

.module-card h2 a:hover {
  text-decoration: underline;
}

.module-status.is-pending {
  color: var(--accent);
  border-color: #c5d0cb;
}

.dash-footnote {
  margin-top: 3rem;
  color: var(--muted);
  font-size: 0.8125rem;
}

@media (max-width: 640px) {
  .topbar {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .module-card {
    flex-direction: column;
  }

  .dash {
    overflow-x: hidden;
  }

  .topbar-actions a,
  .topbar-actions button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
}
