:root {
  color-scheme: light;
  --background: #f5f6f2;
  --paper: #fff;
  --ink: #202c24;
  --muted: #7e887f;
  --line: #e8ebe4;
  --green: #577a60;
  --green-dark: #3f6248;
  --green-soft: #eaf0e8;
  --coral: #cb765f;
  --danger: #a94438;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(ellipse at 8% 2%, rgba(218, 228, 211, 0.55), transparent 32rem),
    var(--background);
  color: var(--ink);
  font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.page-shell {
  min-height: 100vh;
  padding: 54px 24px 30px;
}

.container {
  width: min(100%, 1120px);
  margin-inline: auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  align-items: center;
  gap: 44px;
  margin-bottom: 48px;
}

.hero-copy,
.clock-panel,
.calendar-cell {
  opacity: 1;
}

.eyebrow,
.section-kicker,
.clock-label {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--green);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.eyebrow {
  margin-bottom: 14px;
}

.eyebrow-dot,
.clock-indicator {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--coral);
}

.hero h1 {
  margin: 0;
  font-family: "Manrope", "DM Sans", sans-serif;
  font-size: clamp(2.8rem, 5.5vw, 4.4rem);
  font-weight: 700;
  letter-spacing: -0.075em;
  line-height: 1.07;
}

.hero h1 span {
  color: var(--green);
}

.hero-description {
  max-width: 470px;
  margin: 17px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}

.month-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
}

.progress-number {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #dce5d9;
  border-radius: 14px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-family: "Manrope", sans-serif;
  font-size: 19px;
  font-weight: 700;
}

.progress-copy,
.progress-copy strong,
.progress-copy span {
  display: block;
}

.progress-copy strong {
  font-size: 12px;
  font-weight: 700;
}

.progress-copy span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.clock-panel {
  position: relative;
  overflow: hidden;
  min-height: 190px;
  padding: 25px;
  border-radius: 22px;
  background: #263a2d;
  box-shadow: 0 18px 44px rgba(40, 60, 43, 0.13);
  color: #fff;
}

.clock-label {
  position: relative;
  z-index: 1;
  color: #c4d2c3;
  font-size: 9px;
}

.clock-indicator {
  width: 6px;
  height: 6px;
  background: #b2d091;
  box-shadow: 0 0 12px rgba(178, 208, 145, 0.75);
}

.today-number {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-top: 14px;
  font-family: "Manrope", sans-serif;
  font-size: 64px;
  font-weight: 600;
  letter-spacing: -0.07em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.today-month {
  color: #c4d2c3;
  font-family: "DM Sans", sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
}

.clock-date {
  position: relative;
  z-index: 1;
  margin-top: 8px;
  color: #c4d2c3;
  font-size: 12px;
}

.clock-lunar-date {
  position: relative;
  z-index: 1;
  margin-top: 4px;
  color: #e1eadc;
  font-size: 12px;
}

.clock-decoration {
  position: absolute;
  right: -54px;
  bottom: -116px;
  width: 230px;
  height: 230px;
  border: 1px solid rgba(217, 231, 210, 0.11);
  border-radius: 50%;
}

.clock-decoration::before,
.clock-decoration::after {
  position: absolute;
  border: 1px solid rgba(217, 231, 210, 0.1);
  border-radius: 50%;
  content: "";
}

.clock-decoration::before {
  inset: 22px;
}

.clock-decoration::after {
  inset: 44px;
}

.banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: -26px 0 24px;
  padding: 13px 16px;
  border: 1px solid #efd1ca;
  border-radius: 13px;
  background: #fff5f2;
  color: var(--danger);
  font-size: 12px;
}

.calendar-section {
  padding: 27px;
  border: 1px solid rgba(224, 228, 219, 0.85);
  border-radius: 25px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 18px 54px rgba(56, 67, 52, 0.045);
}

.calendar-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.month-heading h2 {
  margin: 5px 0 0;
  font-family: "Manrope", sans-serif;
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.045em;
}

.calendar-controls,
.month-arrows {
  display: flex;
  align-items: center;
  gap: 8px;
}

.month-arrows {
  gap: 4px;
  margin-left: 4px;
}

.btn,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.btn:active:not(:disabled),
.icon-button:active:not(:disabled) {
  transform: scale(0.96);
}

.btn:disabled,
.icon-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-today {
  min-height: 34px;
  padding: 7px 12px;
  border-color: var(--line);
  border-radius: 9px;
  background: var(--paper);
  font-size: 11px;
  font-weight: 700;
}

.btn-today:hover:not(:disabled) {
  border-color: #cbd9c7;
  background: #f7faf5;
}

.icon-button {
  width: 34px;
  height: 34px;
  border-color: var(--line);
  border-radius: 9px;
  background: var(--paper);
  color: var(--green-dark);
  font-size: 23px;
  line-height: 1;
}

.icon-button:hover:not(:disabled) {
  border-color: #cbd9c7;
  background: var(--green-soft);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--line);
  gap: 1px;
}

.weekday {
  display: grid;
  min-width: 0;
  min-height: 39px;
  place-items: center;
  background: #f7f8f5;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.weekday-short {
  display: none;
}

.calendar-cell {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 120px;
  flex-direction: column;
  padding: 9px;
  background: var(--paper);
  cursor: pointer;
  transition: background 150ms ease;
}

.calendar-cell:not(.is-empty):hover {
  background: #fbfcfa;
}

.calendar-cell:focus-visible {
  z-index: 1;
  outline: 3px solid rgba(87, 122, 96, 0.45);
  outline-offset: -3px;
}

.calendar-cell.is-empty {
  background: #f8f9f7;
}

.calendar-cell.is-today {
  background: #f1f6ef;
}

.cell-top {
  display: flex;
  min-height: 23px;
  align-items: center;
  justify-content: space-between;
  gap: 3px;
}

.cell-date-labels {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 4px;
}

.date-number {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: #485449;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.lunar-date {
  overflow: hidden;
  color: #89948a;
  font-size: 8px;
  line-height: 1.2;
  white-space: nowrap;
}

.today-number-badge {
  background: var(--green);
  color: #fff;
}

.add-task-button {
  display: grid;
  width: 23px;
  height: 23px;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #879187;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 140ms ease, background 140ms ease, color 140ms ease;
}

.calendar-cell:hover .add-task-button,
.add-task-button:focus-visible {
  opacity: 1;
}

.add-task-button:hover {
  background: var(--green-soft);
  color: var(--green-dark);
}

.cell-tasks {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  margin-top: 6px;
}

.task-chip,
.dialog-task {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 3px;
  border-radius: 6px;
  background: #edf3eb;
}

.task-chip {
  min-height: 22px;
  padding: 2px 3px 2px 5px;
}

.task-chip.is-done,
.dialog-task.is-done {
  background: #f2f3f0;
}

.task-toggle {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--green-dark);
  text-align: left;
  cursor: pointer;
}

.task-check {
  display: grid;
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #9db59b;
  border-radius: 4px;
  background: #fff;
  font-size: 9px;
  line-height: 1;
}

.is-done .task-check {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.task-title {
  display: block;
  overflow: hidden;
  font-size: 10px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.is-done .task-title {
  color: #91998f;
  text-decoration: line-through;
}

.task-delete {
  display: grid;
  width: 17px;
  height: 18px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #8f998e;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
}

.task-chip:hover .task-delete,
.task-delete:focus-visible {
  opacity: 1;
}

.task-delete:hover {
  background: #fbe8e3;
  color: var(--danger);
}

.more-tasks {
  overflow: hidden;
  padding: 1px 3px;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-error {
  color: var(--danger);
  font-size: 9px;
}

.loading-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.calendar-legend {
  display: flex;
  align-items: center;
  gap: 17px;
  margin-top: 16px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.legend-today {
  background: var(--green);
}

.legend-task {
  background: #a9c2a6;
}

.legend-hint {
  margin-left: auto;
  color: #929b91;
  font-size: 10px;
}

.footer-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
  color: var(--muted);
  font-size: 10px;
}

.footer-sparkle {
  color: var(--coral);
  font-size: 13px;
}

.dialog-backdrop {
  position: fixed;
  z-index: 10;
  inset: 0;
  display: grid;
  overflow-y: auto;
  place-items: center;
  padding: 20px;
  background: rgba(25, 36, 28, 0.42);
  backdrop-filter: blur(4px);
}

.task-dialog {
  position: relative;
  width: min(100%, 430px);
  padding: 29px;
  border: 1px solid rgba(224, 228, 219, 0.9);
  border-radius: 21px;
  background: var(--paper);
  box-shadow: 0 24px 80px rgba(25, 36, 28, 0.2);
}

.dialog-close {
  position: absolute;
  top: 16px;
  right: 17px;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
}

.task-dialog h2 {
  margin: 5px 0 0;
  font-family: "Manrope", sans-serif;
  font-size: 25px;
  letter-spacing: -0.04em;
}

.dialog-description {
  margin: 6px 0 19px;
  color: var(--muted);
  font-size: 12px;
}

.dialog-lunar-date {
  margin: -12px 0 18px;
  color: var(--green);
  font-size: 12px;
  font-weight: 600;
}

.dialog-task-list {
  display: grid;
  gap: 7px;
  max-height: 170px;
  overflow-y: auto;
  margin-bottom: 19px;
}

.dialog-task-list h3 {
  margin: 0 0 1px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.dialog-task {
  min-height: 34px;
  padding: 5px 7px;
}

.dialog-task .task-check {
  width: 15px;
  height: 15px;
}

.dialog-task .task-title {
  font-size: 12px;
}

.dialog-task-delete {
  padding: 4px 7px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--danger);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
}

.dialog-task-delete:hover {
  background: #fff0ec;
}

.task-input {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: none;
  background: #fafbf9;
  color: var(--ink);
  font-size: 13px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.task-input:focus {
  border-color: #9eb69b;
  box-shadow: 0 0 0 3px rgba(103, 139, 105, 0.1);
}

.task-input::placeholder {
  color: #a3aaa1;
}

.dialog-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.input-counter {
  color: var(--muted);
  font-size: 10px;
}

.btn-save {
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 9px;
  background: var(--green);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.btn-save:hover:not(:disabled) {
  background: var(--green-dark);
}

.btn-retry {
  min-height: 32px;
  padding: 6px 10px;
  border-color: #e5b9ae;
  border-radius: 8px;
  background: transparent;
  color: var(--danger);
  font-size: 10px;
  font-weight: 700;
}

.dialog-error {
  margin: 10px 0 0;
  color: var(--danger);
  font-size: 11px;
}

.sr-only {
  position: absolute;
  overflow: hidden;
  width: 1px;
  height: 1px;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.no-js {
  width: min(calc(100% - 32px), 640px);
  margin: 30px auto;
  padding: 16px;
  border: 1px solid #e7d5a2;
  border-radius: 12px;
  background: #fff8e5;
}

.btn:focus-visible,
.icon-button:focus-visible,
.add-task-button:focus-visible,
.task-toggle:focus-visible,
.task-delete:focus-visible,
.dialog-task-delete:focus-visible,
.dialog-close:focus-visible,
.task-input:focus-visible {
  outline: 3px solid rgba(87, 122, 96, 0.3);
  outline-offset: 2px;
}

@media (max-width: 800px) {
  .page-shell {
    padding: 38px 18px 26px;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 24px;
    margin-bottom: 36px;
  }

  .clock-panel {
    min-height: 175px;
    padding: 22px;
  }

  .today-number {
    font-size: 56px;
  }

  .calendar-section {
    padding: 20px;
  }

  .calendar-cell {
    min-height: 104px;
    padding: 7px;
  }

  .calendar-legend {
    flex-wrap: wrap;
    gap: 10px 16px;
  }
}

@media (max-width: 600px) {
  .page-shell {
    padding: 27px 12px 22px;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 19px;
    margin-bottom: 25px;
  }

  .hero h1 {
    font-size: clamp(2.8rem, 12vw, 3.8rem);
  }

  .hero-description {
    max-width: 410px;
    margin-top: 12px;
    font-size: 12px;
  }

  .month-progress {
    margin-top: 15px;
  }

  .clock-panel {
    min-height: auto;
    padding: 17px 20px;
    border-radius: 17px;
  }

  .today-number {
    gap: 9px;
    margin-top: 8px;
    font-size: 46px;
  }

  .clock-date {
    margin-top: 4px;
    font-size: 11px;
  }

  .clock-lunar-date {
    font-size: 11px;
  }

  .calendar-section {
    padding: 14px 9px;
    border-radius: 18px;
  }

  .calendar-toolbar {
    align-items: center;
    gap: 5px;
    margin: 0 3px 12px;
  }

  .section-kicker {
    font-size: 8px;
  }

  .month-heading h2 {
    font-size: 17px;
  }

  .calendar-controls {
    gap: 4px;
  }

  .month-arrows {
    gap: 3px;
    margin-left: 0;
  }

  .btn-today {
    min-height: 30px;
    padding: 5px 7px;
    font-size: 9px;
  }

  .icon-button {
    width: 30px;
    height: 30px;
  }

  .calendar-grid {
    border-radius: 10px;
  }

  .weekday {
    min-height: 31px;
    font-size: 9px;
  }

  .weekday-full {
    display: none;
  }

  .weekday-short {
    display: inline;
  }

  .calendar-cell {
    min-height: 82px;
    padding: 3px 2px;
  }

  .cell-top {
    min-height: 20px;
    justify-content: center;
  }

  .cell-date-labels {
    gap: 2px;
  }

  .date-number {
    width: 18px;
    height: 18px;
    font-size: 9px;
  }

  .lunar-date {
    font-size: 7px;
  }

  .add-task-button {
    position: absolute;
    z-index: 1;
    top: 2px;
    right: 1px;
    width: 15px;
    height: 15px;
    border-radius: 4px;
    font-size: 13px;
    opacity: 1;
  }

  .cell-tasks {
    gap: 3px;
    margin-top: 3px;
  }

  .task-chip {
    min-height: 16px;
    gap: 2px;
    padding: 1px 2px;
    border-radius: 4px;
  }

  .task-toggle {
    gap: 2px;
  }

  .task-check {
    width: 8px;
    height: 8px;
    border-radius: 3px;
    font-size: 6px;
  }

  .task-title {
    font-size: 8px;
    line-height: 1.2;
  }

  .task-delete {
    display: none;
  }

  .more-tasks {
    padding-inline: 1px;
    font-size: 7px;
  }

  .cell-error {
    font-size: 7px;
  }

  .legend-item,
  .legend-hint {
    font-size: 8px;
  }

  .calendar-legend {
    gap: 8px 12px;
    margin: 12px 3px 0;
  }

  .legend-hint {
    flex-basis: 100%;
    margin-left: 0;
  }

  .footer-note {
    margin-top: 18px;
    font-size: 9px;
    text-align: center;
  }

  .task-dialog {
    padding: 25px 19px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.workspace-bar {
  position: relative;
  z-index: 2;
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 10px max(24px, calc((100vw - 1120px) / 2));
  border-bottom: 1px solid rgba(224, 228, 219, 0.85);
  background: rgba(255, 255, 255, 0.92);
}

.workspace-brand,
.workspace-account,
.workspace-tabs {
  display: flex;
  align-items: center;
}

.workspace-brand {
  gap: 9px;
  color: var(--ink);
  font-family: "Manrope", sans-serif;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.workspace-brand-mark {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 10px;
  background: var(--green);
  color: #fff;
}

.workspace-tabs {
  gap: 5px;
}

.workspace-tab,
.workspace-logout {
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.workspace-tab:hover,
.workspace-tab.active {
  background: var(--green-soft);
  color: var(--green-dark);
}

.workspace-account {
  gap: 12px;
  white-space: nowrap;
}

.workspace-username {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 160px;
  overflow: hidden;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  text-overflow: ellipsis;
}

.workspace-username:hover {
  border-color: var(--line);
  background: #f7faf5;
  color: var(--green-dark);
}

.workspace-username:focus-visible,
.account-dialog-tabs button:focus-visible {
  outline: 3px solid rgba(87, 122, 96, 0.3);
  outline-offset: 2px;
}

.workspace-logout {
  min-height: 32px;
  border-color: var(--line);
  background: #fff;
}

.workspace-logout:hover {
  border-color: #cbd9c7;
  color: var(--green-dark);
}

.workspace-error {
  width: min(calc(100% - 32px), 720px);
  margin: 12px auto -25px;
  color: var(--danger);
  font-size: 12px;
}

.account-dialog {
  width: min(100%, 480px);
  max-height: min(90vh, 760px);
  overflow-y: auto;
}

.account-dialog h2 {
  margin: 5px 0 0;
  font-family: "Manrope", sans-serif;
  font-size: 25px;
  letter-spacing: -0.04em;
}

.account-dialog-tabs {
  display: flex;
  gap: 6px;
  margin: 20px 0 15px;
  padding: 4px;
  border-radius: 11px;
  background: #f4f6f2;
}

.account-dialog-tabs button {
  min-height: 35px;
  flex: 1;
  padding: 7px 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.account-dialog-tabs button.active {
  background: #fff;
  color: var(--green-dark);
  box-shadow: 0 1px 4px rgba(32, 44, 36, 0.08);
}

.account-form {
  display: grid;
  gap: 9px;
}

.account-form label {
  margin-top: 5px;
  color: #4e5b50;
  font-size: 11px;
  font-weight: 700;
}

.account-form input {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
}

.account-form input:focus {
  border-color: #9eb69b;
  box-shadow: 0 0 0 3px rgba(103, 139, 105, 0.1);
}

.account-form .btn-save {
  justify-self: start;
  margin-top: 8px;
}

.account-form-hint {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.account-message {
  margin: 0 0 12px;
  font-size: 11px;
}

.account-message.error {
  color: var(--danger);
}

.account-message.success {
  color: var(--green-dark);
}

.login-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(100%, 430px);
  padding: 38px;
  border: 1px solid rgba(224, 228, 219, 0.9);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 22px 70px rgba(56, 67, 52, 0.09);
}

.login-card h1 {
  margin: 8px 0 0;
  font-family: "Manrope", sans-serif;
  font-size: clamp(2.3rem, 10vw, 3rem);
  letter-spacing: -0.07em;
  line-height: 1.08;
}

.login-card h1 span {
  color: var(--green);
}

.login-description,
.login-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.login-description {
  margin: 13px 0 24px;
}

.login-form,
.portal-form {
  display: grid;
  gap: 9px;
}

.login-form label,
.portal-form label {
  margin-top: 7px;
  color: #4e5b50;
  font-size: 11px;
  font-weight: 700;
}

.login-form input,
.portal-form input,
.portal-form textarea,
.portal-filters input,
.portal-filters select {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
}

.login-form input:focus,
.portal-form input:focus,
.portal-form textarea:focus,
.portal-filters input:focus,
.portal-filters select:focus {
  border-color: #9eb69b;
  box-shadow: 0 0 0 3px rgba(103, 139, 105, 0.1);
}

.login-submit,
.portal-submit {
  width: 100%;
  min-height: 43px;
  margin-top: 13px;
}

.login-error {
  padding: 10px 12px;
  border: 1px solid #efd1ca;
  border-radius: 9px;
  background: #fff5f2;
  color: var(--danger);
  font-size: 11px;
}

.login-hint {
  margin: 17px 0 0;
  text-align: center;
}

.login-loading {
  color: var(--muted);
  font-size: 13px;
}

.portal-shell {
  padding-top: 38px;
}

.portal-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 25px;
}

.portal-intro h1 {
  margin: 4px 0 0;
  font-family: "Manrope", sans-serif;
  font-size: clamp(2rem, 5vw, 2.7rem);
  letter-spacing: -0.065em;
}

.portal-intro p,
.portal-form-description {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.portal-count {
  display: grid;
  min-width: 96px;
  padding: 11px 15px;
  border: 1px solid #dce5d9;
  border-radius: 13px;
  background: var(--green-soft);
  color: var(--green-dark);
  text-align: center;
}

.portal-count strong {
  font-family: "Manrope", sans-serif;
  font-size: 20px;
  line-height: 1.2;
}

.portal-count span {
  font-size: 9px;
  font-weight: 700;
}

.portal-notice {
  margin-bottom: 15px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 11px;
}

.portal-notice.success {
  border-color: #cfe0c9;
  background: #f1f7ef;
  color: var(--green-dark);
}

.portal-notice.error {
  border-color: #efd1ca;
  background: #fff5f2;
  color: var(--danger);
}

.portal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.8fr);
  align-items: start;
  gap: 18px;
}

.portal-panel {
  min-width: 0;
  padding: 22px;
  border: 1px solid rgba(224, 228, 219, 0.9);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 12px 35px rgba(56, 67, 52, 0.04);
}

.portal-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.portal-panel-heading h2,
.portal-form-panel h2 {
  margin: 4px 0 0;
  font-family: "Manrope", sans-serif;
  font-size: 20px;
  letter-spacing: -0.04em;
}

.portal-count-pill,
.portal-entry-category {
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 9px;
  font-weight: 700;
}

.portal-filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 0.55fr);
  gap: 8px;
  margin: 16px 0;
}

.portal-views {
  display: flex;
  gap: 6px;
  margin-top: 16px;
  padding: 4px;
  border-radius: 10px;
  background: #f2f4ef;
}

.portal-views button {
  min-height: 34px;
  padding: 7px 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #69746a;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.portal-views button.active {
  background: #fff;
  color: var(--green-dark);
  box-shadow: 0 1px 4px rgba(56, 67, 52, 0.09);
}

.portal-entry-list {
  display: grid;
  gap: 10px;
}

.portal-entry {
  position: relative;
  padding: 14px 42px 14px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.portal-entry-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.portal-entry-heading time {
  color: var(--muted);
  font-size: 9px;
}

.portal-entry h3 {
  margin: 9px 0 3px;
  font-size: 13px;
}

.portal-entry p {
  margin: 5px 0 0;
  color: #69746a;
  font-size: 11px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.portal-delete,
.portal-restore {
  position: absolute;
  top: 12px;
  right: 11px;
  padding: 5px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--danger);
  font-size: 10px;
  cursor: pointer;
}

.portal-delete:hover {
  background: #fff0ec;
}

.portal-restore {
  color: var(--green-dark);
}

.portal-restore:hover {
  background: var(--green-soft);
}

.portal-empty {
  margin: 25px 0;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.portal-form-panel {
  position: sticky;
  top: 15px;
}

.portal-form-description {
  margin-bottom: 17px;
  line-height: 1.6;
}

.portal-form {
  gap: 7px;
}

.portal-form textarea {
  min-height: 120px;
  resize: vertical;
}

@media (max-width: 800px) {
  .portal-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .portal-form-panel {
    position: static;
  }
}

@media (max-width: 600px) {
  .workspace-bar {
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 9px 12px;
    padding: 10px 13px;
  }

  .workspace-brand {
    flex: 1;
  }

  .workspace-tabs {
    order: 3;
    width: 100%;
  }

  .workspace-tab {
    flex: 1;
    padding-inline: 6px;
    font-size: 10px;
  }

  .workspace-account {
    gap: 6px;
  }

  .workspace-username {
    max-width: 120px;
    padding-inline: 6px;
  }

  .workspace-logout {
    padding-inline: 8px;
    font-size: 10px;
  }

  .account-dialog {
    padding: 25px 19px;
  }

  .portal-shell {
    padding-top: 25px;
  }

  .portal-intro {
    align-items: center;
    gap: 10px;
  }

  .portal-intro p {
    max-width: 260px;
    line-height: 1.5;
  }

  .portal-count {
    min-width: 74px;
    padding: 9px;
  }

  .portal-panel {
    padding: 16px 13px;
  }

  .portal-filters {
    grid-template-columns: 1fr;
  }

  .portal-entry-heading {
    align-items: start;
    flex-direction: column;
    gap: 7px;
  }

  .login-card {
    padding: 29px 23px;
  }
}
