* {
  box-sizing: border-box;
}

:root {
  color: #202122;
  background: #fff;
  font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Arial,
    sans-serif;
}
body {
  margin: 0;
  background: #fff;
}
h1,
h2,
p {
  margin-top: 0;
}
h1 {
  margin-bottom: 0;
  font-size: clamp(1.9rem, 5vw, 2.7rem);
  letter-spacing: -0.05em;
}
h2 {
  margin-bottom: 12px;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}
.container {
  width: min(100% - 32px, 980px);
  margin: 36px auto 64px;
}
.card {
  padding: 20px;
  border: 1px solid #c8ddeb;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 28px rgb(42 92 131 / 8%);
}
.eyebrow,
.section-label {
  margin-bottom: 5px;
  color: #4b7fa5;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 30px;
}
.topbar > div > strong {
  font-size: 1.45rem;
  letter-spacing: -0.03em;
}
.topbar-user {
  margin: 5px 0 0;
  color: #66829a;
  font-size: 0.88rem;
}
.topbar nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 14px;
}
.topbar a,
.back-link,
.secondary-link,
.text-action {
  color: #3179a8;
  font-size: 0.9rem;
  font-weight: 750;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.topbar .nav-add,
button,
.button-link {
  display: inline-block;
  padding: 10px 14px;
  border: 1px solid #3d82b2;
  border-radius: 8px;
  background: #3d82b2;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 750;
  text-decoration: none;
}
.topbar .nav-add {
  padding: 7px 10px;
}
button:hover:not(:disabled),
.button-link:hover,
.topbar .nav-add:hover {
  background: #2e6e9c;
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
label {
  display: block;
  margin: 18px 0 7px;
  font-size: 0.86rem;
  font-weight: 750;
}
input,
select,
textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #acc9dd;
  border-radius: 8px;
  background: #fff;
  color: #203a54;
  font: inherit;
}
textarea {
  resize: vertical;
}
input:focus,
select:focus,
textarea:focus {
  border-color: #3d82b2;
  box-shadow: 0 0 0 3px rgb(61 130 178 / 18%);
  outline: none;
}
.msg {
  min-height: 1.25em;
  margin: 14px 0 0;
  color: #952c2c;
}
.msg:not(:empty),
.error-panel {
  padding: 10px 12px;
  border: 1px solid #efc1c1;
  border-radius: 8px;
  background: #fff5f4;
  color: #8c2020;
  font-size: 0.9rem;
}
.flash-message {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #b9d9c7;
  border-radius: 8px;
  background: #f0faf3;
  color: #16603f;
  font-size: 0.9rem;
  font-weight: 700;
}
.page-view,
.section-stack,
.topic-list,
.history-list {
  display: grid;
  gap: 16px;
}
.page-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}
.inline-actions,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.description {
  max-width: 720px;
  white-space: pre-wrap;
  color: #566474;
  line-height: 1.55;
}
.section-card {
  overflow: hidden;
  border: 1px solid #c8ddeb;
  border-radius: 13px;
  background: #fff;
}
.section-card h2 {
  margin: 0;
  padding: 14px 17px;
  border-bottom: 1px solid #dce8f1;
  background: #f6fbff;
}
.task-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px 17px;
  border-bottom: 1px solid #e0ecf5;
}
.task-row:last-child {
  border-bottom: 0;
}
.task-copy {
  min-width: 0;
}
.task-title {
  color: #203a54;
  font-weight: 800;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 5px;
  color: #66829a;
  font-size: 0.78rem;
}
.chip {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  background: #e7f3fc;
  color: #3779a5;
  font-size: 0.72rem;
  font-weight: 750;
}
.chip.overdue {
  background: #fae2df;
  color: #a34235;
}
.chip.today {
  background: #f8edcf;
  color: #8c6315;
}
.chip.complete {
  background: #e2f2e7;
  color: #287143;
}
.task-row.is-completed {
  opacity: 0.62;
}
.task-row.is-completed .task-title {
  font-size: 0.92em;
  font-weight: 650;
}
.task-row.is-completed .task-meta {
  font-size: 0.72rem;
}
.completed-section {
  opacity: 0.8;
}
.task-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.task-actions button {
  padding: 7px 9px;
  font-size: 0.82rem;
}
.empty-panel {
  padding: 28px;
  text-align: center;
  color: #647383;
}
.topic-row {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  gap: 13px;
  align-items: center;
  padding: 17px;
  border: 1px solid #cad5df;
  border-radius: 13px;
  background: #fff;
}
.topic-color {
  width: 10px;
  height: 38px;
  border-radius: 999px;
  background: #7d8d9c;
}
.topic-color.blue {
  background: #4a81b3;
}
.topic-color.green {
  background: #57916a;
}
.topic-color.amber {
  background: #bd8c35;
}
.topic-color.rose {
  background: #af6173;
}
.topic-color.violet {
  background: #7b6db0;
}
.topic-row strong {
  display: block;
}
.topic-row p {
  margin: 4px 0 0;
  color: #687887;
  font-size: 0.86rem;
}
.topic-stats {
  color: #687887;
  font-size: 0.82rem;
  text-align: right;
}
.task-tree {
  display: grid;
  gap: 8px;
}
.tree-children {
  display: grid;
  gap: 8px;
  margin-left: 22px;
  padding-left: 12px;
  border-left: 1px solid #cbd8e2;
}
.tree-row {
  border: 1px solid #d4dfe7;
  border-radius: 10px;
  background: #fff;
}
.tree-row .task-row {
  border: 0;
}
.form-view {
  max-width: 680px;
}
.back-link {
  display: inline-block;
  margin-bottom: 18px;
}
.form-card {
  margin-top: 18px;
}
.form-card label:first-of-type {
  margin-top: 0;
}
.burn-after-completion {
  display: flex;
  gap: 8px;
  align-items: center;
}
.burn-after-completion input {
  width: auto;
  min-height: 0;
  padding: 0;
}
.burn-after-completion + .field-help {
  margin-top: -2px;
}
.quiet-button {
  border-color: #8997a5;
  background: transparent;
  color: #435667;
}
.quiet-button:hover:not(:disabled) {
  background: #edf2f5;
}
.schedule-fieldset {
  margin: 22px 0 0;
  padding: 0 16px 16px;
  border: 1px solid #cad5df;
  border-radius: 10px;
}
.schedule-fieldset legend {
  padding: 0 5px;
  font-size: 0.9rem;
  font-weight: 800;
}
.schedule-fields {
  margin-top: 12px;
}
.two-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.two-fields label {
  margin-top: 0;
}
.field-help {
  margin: 0 0 8px;
  color: #687887;
  font-size: 0.85rem;
}
.month-checks {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}
.month-checks label {
  display: flex;
  gap: 7px;
  align-items: center;
  margin: 0;
  padding: 7px;
  border: 1px solid #d6e0e7;
  border-radius: 7px;
  font-weight: 600;
}
.month-checks input {
  width: auto;
}
.schedule-history {
  margin-top: 16px;
  color: #637484;
  font-size: 0.82rem;
}
.schedule-history ul {
  margin: 7px 0 0;
  padding-left: 18px;
}
.state-line {
  padding: 11px 13px;
  border-radius: 9px;
  background: #eaf0f5;
  color: #3d5970;
  font-weight: 700;
}
.completion-list {
  display: grid;
  gap: 0;
  border-top: 1px solid #dce4eb;
}
.completion-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid #dce4eb;
}
.completion-row p {
  margin: 4px 0 0;
  color: #697887;
  font-size: 0.84rem;
  white-space: pre-wrap;
}
.completion-row button {
  padding: 4px 7px;
  border-color: transparent;
  background: transparent;
  color: #9b3838;
  font-size: 0.77rem;
}
.filter-bar {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(120px, 0.8fr) minmax(120px, 0.8fr) auto;
  gap: 8px;
  align-items: end;
  padding: 13px;
  border: 1px solid #cad5df;
  border-radius: 11px;
  background: #f8fafb;
}
.filter-bar label {
  margin: 0;
}
.filter-bar button {
  white-space: nowrap;
}
.history-day h2 {
  margin: 8px 0;
  font-size: 0.96rem;
}
.history-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px;
  border: 1px solid #d4dfe7;
  border-bottom: 0;
  background: #fff;
}
.history-row:last-child {
  border-bottom: 1px solid #d4dfe7;
  border-radius: 0 0 9px 9px;
}
.history-row:first-of-type {
  border-radius: 9px 9px 0 0;
}
.history-row p {
  margin: 4px 0 0;
  color: #687887;
  font-size: 0.82rem;
}
.login-container {
  max-width: 460px;
  margin-top: 12vh;
}
.login-card {
  margin-top: 20px;
}
@media (max-width: 640px) {
  .container {
    width: min(100% - 24px, 980px);
    margin-top: 20px;
  }
  .topbar {
    flex-direction: column;
    margin-bottom: 22px;
  }
  .topbar nav {
    justify-content: flex-start;
  }
  .page-heading {
    align-items: flex-start;
    flex-direction: column;
  }
  .task-row,
  .topic-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .topic-color {
    display: none;
  }
  .task-actions {
    grid-column: 1 / -1;
  }
  .topic-stats {
    grid-column: 1 / -1;
    text-align: left;
  }
  .two-fields,
  .filter-bar {
    grid-template-columns: 1fr;
  }
  .month-checks {
    grid-template-columns: 1fr 1fr;
  }
  .completion-row,
  .history-row {
    flex-direction: column;
    gap: 6px;
  }
}

.card,
.section-card,
.topic-row,
.tree-row,
.history-row {
  border-color: #a8dff1;
  background: #fff;
}

h1,
h2,
h3,
p,
label,
.task-title,
.description,
.topic-row p,
.topic-stats {
  color: #171717;
}

input,
select,
textarea {
  border-color: #9bd8ee;
  color: #171717;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #1687b8;
  box-shadow: 0 0 0 3px rgb(22 135 184 / 20%);
}

.topbar .nav-add,
button,
.button-link {
  border-color: #1687b8;
  background: #1687b8;
}

button:hover:not(:disabled),
.button-link:hover,
.topbar .nav-add:hover {
  background: #08709e;
}

.container {
  width: min(100% - 32px, 900px);
}
.card,
.section-card,
.topic-row,
.tree-row,
.history-row {
  border-color: #c8ccd1;
  border-radius: 5px;
  background: #fff;
  box-shadow: none;
}
.topbar a,
.back-link,
.secondary-link,
.text-action {
  color: #36c;
}

/* Keep login geometry consistent across the workspace; theme colors stay app-specific. */
.login-container {
  width: min(100% - 32px, 460px);
  max-width: 460px;
  margin: 12vh auto 64px;
  padding: 0;
}

.login-container h1 {
  margin: 0;
  font-size: 2.5rem;
  line-height: 1.15;
}

.login-card {
  display: block;
  min-height: 296px;
  margin-top: 20px;
  padding: 20px;
}

.login-card label {
  margin: 18px 0 7px;
  font-size: 14px;
  line-height: 19px;
}

.login-card label:first-of-type {
  margin-top: 0;
}

.login-card input {
  display: block;
  width: 100%;
  height: 42px;
  padding: 10px 11px;
}

.login-card button {
  display: block;
  width: 100%;
  min-height: 42px;
  margin-top: 20px;
  padding: 10px 14px;
  font-size: 14px;
  line-height: 20px;
}

.login-card .msg {
  min-height: 20px;
  margin: 14px 0 0;
  font-size: 14px;
  line-height: 20px;
}

@media (max-width: 640px) {
  .login-container {
    width: min(100% - 24px, 460px);
    margin: 24px auto 48px;
    padding: 0;
  }

  .login-card {
    padding: 20px;
  }
}

/* Match the shared Daily and One Line Diary content column. */
.container:not(.login-container) {
  max-width: 560px;
  margin: 48px auto;
  padding: 0 20px;
}

@media (max-width: 640px) {
  .container:not(.login-container) {
    margin: 20px auto;
    padding: 0 16px;
  }
}

@media (max-width: 380px) {
  .container:not(.login-container) {
    padding: 0 12px;
  }
}

/* Start every Attention view at the top edge of the app, including login. */
#app > .container:not(.login-container) {
  margin: 0 auto 48px;
}

#app > .login-container {
  margin: 0 auto 64px;
}

/* Attention theme tokens for common/design.css. */
:root {
  --ui-background: #f5f9fc;
  --ui-surface: #ffffff;
  --ui-ink: #1f3548;
  --ui-muted: #60798d;
  --ui-border: #c8ddeb;
  --ui-field-border: #acc9dd;
  --ui-accent: #287da9;
  --ui-accent-strong: #1d628a;
  --ui-accent-soft: #e7f4fb;
  --ui-accent-soft-border: #b8dded;
  --ui-focus: rgb(40 125 169 / 24%);
}
