:root {
  --bg: #f5f7f8;
  --panel: #ffffff;
  --ink: #182322;
  --muted: #64716f;
  --line: #dce4e2;
  --brand: #126c5c;
  --brand-dark: #0d5146;
  --accent: #d99636;
  --danger: #a83d3d;
  --shadow: 0 18px 45px rgba(26, 39, 38, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(245, 247, 248, 0.86), rgba(245, 247, 248, 0.92)),
    var(--planner-bg-image, none);
  background-position: center;
  background-size: cover;
  background-attachment: fixed;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

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

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar h1 {
  font-size: clamp(1.1rem, 2.5vw, 2.2rem);
  line-height: 1.08;
  max-width: 520px;
}

.profile-button {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid #cbd6d4;
  border-radius: 999px;
  background: #ffffff;
  color: #07182b;
  cursor: pointer;
  font-weight: 900;
}

.profile-button:hover {
  box-shadow: 0 10px 22px rgba(24, 35, 34, 0.14);
}

.create-menu {
  position: relative;
}

.create-menu-list {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 25;
  display: none;
  min-width: 190px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 38px rgba(24, 35, 34, 0.16);
}

.create-menu-list.is-open {
  display: grid;
}

.create-menu-list button {
  min-height: 42px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  color: #263533;
  cursor: pointer;
  font-weight: 800;
  padding: 10px 12px;
  text-align: left;
}

.create-menu-list button:last-child {
  border-bottom: 0;
}

.create-menu-list button:hover {
  background: #eef3f2;
}

.main-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.menu-secondary-button {
  margin-left: auto;
}

.main-menu-button {
  min-height: 42px;
  border: 1px solid #cbd6d4;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: #31413f;
  cursor: pointer;
  font-weight: 900;
  padding: 9px 13px;
}

.main-menu-button.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
}

.app-section {
  display: none;
}

.app-section.is-visible {
  display: block;
}

[hidden],
.app-section[hidden],
.main-menu-button[hidden],
.profile-button[hidden],
button[hidden] {
  display: none !important;
}

.users-admin-page {
  display: grid;
  gap: 16px;
}

.users-admin-view[hidden],
.app-section[hidden] {
  display: none !important;
}

.admin-action-button {
  min-width: 76px;
}

.users-admin-list {
  display: grid;
  gap: 10px;
}

.users-admin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
  padding: 12px;
}

.admin-notification {
  border: 1px solid #f0d39c;
  border-radius: 8px;
  background: #fff7e8;
  color: #75510d;
  font-weight: 800;
  margin: 0;
  padding: 10px 12px;
}

.approved-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #31413f;
  font-size: 0.86rem;
  font-weight: 900;
  white-space: nowrap;
}

.approved-check input {
  width: auto;
}

.users-admin-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.users-admin-details {
  min-width: 0;
}

.users-admin-details strong,
.users-admin-details span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.users-admin-details span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  margin-top: 2px;
}

.role-pill {
  border-radius: 999px;
  background: #edf2f1;
  color: #263533;
  font-size: 0.78rem;
  font-weight: 900;
  padding: 7px 10px;
  text-transform: uppercase;
}

.role-pill.is-admin {
  background: #dff2ec;
  color: var(--brand);
}

.user-editor-form {
  max-width: 620px;
}

.settings-sidebar {
  position: fixed;
  display: none;
  top: 0;
  right: 0;
  z-index: 30;
  width: min(420px, calc(100vw - 24px));
  height: 100vh;
  overflow-y: auto;
  border-left: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: -22px 0 48px rgba(24, 35, 34, 0.16);
  padding: 20px;
  transform: translateX(105%);
  transition: transform 180ms ease;
}

.settings-sidebar.is-open {
  display: block;
  transform: translateX(0);
}

.brain-button {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 24;
  min-height: 46px;
  border: 0;
  border-radius: 999px;
  background: #07182b;
  color: #ffffff;
  cursor: pointer;
  font-weight: 900;
  padding: 0 18px;
  box-shadow: 0 16px 36px rgba(7, 24, 43, 0.26);
}

.brain-panel {
  position: fixed;
  right: 18px;
  bottom: 78px;
  z-index: 35;
  display: none;
  width: min(420px, calc(100vw - 36px));
  max-height: min(680px, calc(100vh - 110px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 60px rgba(24, 35, 34, 0.22);
  overflow: hidden;
}

.brain-panel.is-open {
  display: grid;
  grid-template-rows: auto minmax(180px, 1fr) auto;
}

.brain-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 14px;
}

.brain-header h2 {
  margin: 0;
  border-left: 0;
  padding-left: 0;
}

.brain-messages {
  display: grid;
  gap: 10px;
  overflow-y: auto;
  padding: 14px;
}

.brain-message {
  border-radius: 8px;
  padding: 10px 12px;
  line-height: 1.4;
}

.brain-message.user {
  justify-self: end;
  max-width: 88%;
  background: var(--brand);
  color: #ffffff;
}

.brain-message.assistant {
  justify-self: start;
  max-width: 92%;
  background: #eef3f2;
}

.brain-message.system {
  justify-self: center;
  background: #fff6df;
  color: #73511d;
  font-size: 0.88rem;
  font-weight: 800;
}

.brain-form {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 14px;
}

.brain-form textarea {
  min-height: 92px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(24, 35, 34, 0.38);
  padding: 18px;
}

.modal.is-open {
  display: flex;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(135deg, rgba(18, 108, 92, 0.88), rgba(7, 24, 43, 0.9)),
    var(--planner-bg-image, none);
  background-position: center;
  background-size: cover;
  padding: 20px;
}

.login-screen.is-visible {
  display: flex;
}

.login-card {
  display: grid;
  gap: 14px;
  width: min(420px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 28px 70px rgba(7, 24, 43, 0.28);
  padding: 24px;
}

.login-card h1 {
  margin: 0;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--brand);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 4px;
  text-align: center;
}

.text-button:hover,
.text-button:focus-visible {
  color: #07182b;
  text-decoration: underline;
}

.inline-reset-button {
  border: 0;
  background: transparent;
  color: var(--brand);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 0;
  text-decoration: underline;
}

.modal-panel {
  width: min(720px, 100%);
  max-height: min(900px, calc(100vh - 36px));
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 28px 70px rgba(24, 35, 34, 0.24);
  padding: 18px;
}

.small-modal {
  width: min(620px, 100%);
}

#categoryModal .modal-panel {
  width: min(1100px, 100%);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.modal-header h2 {
  margin-bottom: 0;
}

.sidebar-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.sidebar-header h2 {
  margin-bottom: 0;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 5vw, 4.4rem);
  line-height: 0.95;
  max-width: 720px;
}

h2 {
  margin-bottom: 6px;
  font-size: 1.15rem;
}

h3 {
  margin-bottom: 5px;
  font-size: 1rem;
  border-left: 4px solid var(--brand);
  padding-left: 9px;
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 0.72fr);
  gap: 18px;
  align-items: start;
}

.workspace-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.78fr) minmax(560px, 1.5fr);
  gap: 18px;
  align-items: start;
}

.workspace-left,
.workspace-right {
  display: grid;
  gap: 18px;
  min-width: 0;
}

body[data-active-section="categories"] .workspace-left,
body[data-active-section="projects"] .workspace-left {
  grid-column: 1 / -1;
}

body[data-active-section="categories"] .app-section[data-section="categories"],
body[data-active-section="projects"] .app-section[data-section="projects"] {
  min-height: 540px;
}

body[data-active-section="calendar"] .workspace-layout,
body[data-active-section="day"] .workspace-layout,
body[data-active-section="week"] .workspace-layout {
  display: block;
}

body[data-active-section="calendar"] .workspace-left,
body[data-active-section="day"] .workspace-left,
body[data-active-section="week"] .workspace-left {
  display: none;
}

body[data-active-section="calendar"] .app-section[data-section="calendar"],
body[data-active-section="day"] .app-section[data-section="calendar"],
body[data-active-section="week"] .app-section[data-section="calendar"] {
  display: block;
  width: 100%;
}

body[data-active-section="category-detail"] .app-section[data-section="category-detail"] {
  grid-column: 1 / -1;
}

body[data-active-section="category-detail"] .workspace-layout {
  display: block;
}

body[data-active-section="category-detail"] .workspace-left {
  display: none;
}

body[data-active-section="category-detail"] .app-section[data-section="calendar"] {
  display: none;
}

body[data-active-section="category-detail"] .app-section[data-section="category-detail"] {
  display: block;
}

body[data-active-section="category-detail"] .category-detail-screen {
  width: 100%;
}

body[data-active-section="day-detail"] .workspace-layout {
  display: block;
}

body[data-active-section="day-detail"] .workspace-left,
body[data-active-section="day-detail"] .app-section[data-section="calendar"] {
  display: none;
}

body[data-active-section="day-detail"] .app-section[data-section="day-detail"] {
  display: block;
  width: 100%;
}

.panel {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-heading p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.category-board-heading {
  align-items: center;
  margin-bottom: 16px;
}

.category-board-heading h2 {
  margin-bottom: 0;
  color: #07182b;
  font-size: 1rem;
}

.create-category-button span {
  font-size: 1.4rem;
  font-weight: 500;
  line-height: 0.8;
}

.planner-form {
  display: grid;
  gap: 14px;
}

.appearance-controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: stretch;
}

.google-setup {
  display: grid;
  gap: 12px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button-row button {
  min-height: 42px;
}

.settings-section,
.google-setup {
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: 16px;
}

.settings-section h3,
.google-setup h3 {
  margin: 0;
  border-left: 0;
  color: #07182b;
  padding-left: 0;
}

.logout-button {
  width: 100%;
  min-height: 44px;
  margin-top: 18px;
}

.google-signin-button {
  background: #ffffff;
  border: 1px solid #cbd6d4;
  color: #263533;
  box-shadow: 0 6px 18px rgba(24, 35, 34, 0.08);
}

.google-signin-button::before {
  content: "G";
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-right: 8px;
  border-radius: 999px;
  background: #4285f4;
  color: white;
  font-weight: 900;
}

.status-line {
  margin-bottom: 0;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.4;
}

.settings-help {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.4;
}

.connected-accounts {
  display: grid;
  gap: 10px;
}

.account-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
  padding: 10px;
}

.account-calendar-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.account-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border: 1px solid #d6dedc;
  border-radius: 999px;
  background: #f6f8f8;
  color: #3c4947;
  padding: 5px 10px;
  font-size: 0.84rem;
  font-weight: 800;
}

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

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

.form-note {
  display: flex;
  align-items: center;
  min-height: 44px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.35;
}

.repeat-fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0;
  padding: 12px;
}

.repeat-fieldset legend {
  color: #31413f;
  font-size: 0.9rem;
  font-weight: 800;
  padding: 0 5px;
}

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

.repeat-grid label:nth-child(3),
.repeat-grid label:nth-child(4),
.repeat-grid label:nth-child(5) {
  grid-column: span 1;
}

label {
  display: grid;
  gap: 7px;
  color: #31413f;
  font-size: 0.9rem;
  font-weight: 700;
}

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

.password-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 8px;
}

.password-field input {
  min-width: 0;
}

.password-toggle {
  min-width: 68px;
  border: 1px solid #cbd6d4;
  border-radius: 8px;
  background: #e8eeee;
  color: #263533;
  cursor: pointer;
  font-weight: 800;
  padding: 0 12px;
}

input[type="color"] {
  min-height: 44px;
  padding: 5px;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(18, 108, 92, 0.12);
}

.primary-button,
.icon-button,
.delete-button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
}

.primary-button {
  min-height: 46px;
  background: var(--brand);
  color: white;
}

.primary-button:hover {
  background: var(--brand-dark);
}

.icon-button {
  background: #e8eeee;
  color: #263533;
  padding: 10px 14px;
}

.delete-button {
  background: #f7e9e9;
  color: var(--danger);
  padding: 8px 10px;
}

.category-list,
.actions {
  display: grid;
  gap: 10px;
}

.category-tiles,
.projects-list {
  display: grid;
  gap: 24px;
  margin-bottom: 0;
}

.tile-board-section {
  display: grid;
  gap: 14px;
}

.tile-board-section h3 {
  margin: 0;
  border-left: 0;
  color: #07182b;
  padding-left: 0;
}

.tile-board-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 16px;
}

.create-category-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: auto;
  min-height: 38px;
  border: 1px solid #cbd6d4;
  border-radius: 4px;
  background: #ffffff;
  color: #07182b;
  cursor: pointer;
  font-weight: 900;
  padding: 8px 12px;
}

.category-tile,
.project-tile {
  position: relative;
  display: block;
  min-height: 220px;
  overflow: hidden;
  border: 0;
  border-bottom: 6px solid var(--category-color, var(--brand));
  border-radius: 8px;
  background-image:
    linear-gradient(180deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.7)),
    var(--category-bg);
  background-position: center;
  background-size: cover;
  color: #ffffff;
  text-align: left;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}

.tile-open {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 10px;
  width: 100%;
  min-height: 220px;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  padding: 24px;
  text-align: left;
  text-shadow: inherit;
}

.tile-menu-slot {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  text-shadow: none;
}

.tile-menu-slot .entity-menu-button {
  min-width: 34px;
  min-height: 34px;
  background: rgba(255, 255, 255, 0.28);
  color: #ffffff;
  backdrop-filter: blur(8px);
}

.tile-menu-slot .entity-menu-button:hover {
  background: rgba(255, 255, 255, 0.42);
}

.category-tile:hover,
.project-tile:hover {
  box-shadow: 0 18px 38px rgba(24, 35, 34, 0.18);
  transform: translateY(-1px);
}

.category-tile.is-archived,
.project-tile.is-archived {
  filter: grayscale(0.28);
  opacity: 0.78;
}

.category-tile i,
.project-tile i {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
}

.category-tile i::after,
.project-tile i::after {
  content: "";
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 999px;
}

.category-tile i.has-icon {
  color: #07182b;
  font-size: 1.05rem;
  font-weight: 900;
  text-shadow: none;
}

.category-tile i.has-icon::after {
  display: none;
}

.category-tile strong,
.project-tile strong {
  max-width: 92%;
  color: #ffffff;
  font-size: clamp(1.3rem, 2.4vw, 2rem);
  line-height: 1;
  text-transform: uppercase;
}

.category-tile span,
.project-tile span {
  display: block;
  max-width: 92%;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.94);
  font-size: 0.95rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-detail {
  margin-bottom: 0;
}

.category-start {
  display: grid;
  gap: 26px;
}

.category-start[hidden],
.category-entry-form[hidden] {
  display: none;
}

.category-name-entry input {
  border-width: 0 0 1px;
  border-radius: 0;
  background: transparent;
  font-size: 1.05rem;
  padding-left: 0;
}

.category-picker-section {
  display: grid;
  gap: 14px;
  border-top: 1px solid #cbd6d4;
  padding-top: 20px;
}

.category-picker-section h3 {
  margin: 0;
  border-left: 0;
  color: #0b5a84;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  padding-left: 0;
  text-transform: uppercase;
}

.color-choice-grid,
.icon-choice-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.color-choice,
.icon-choice {
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
}

.color-choice {
  width: 32px;
  height: 32px;
}

.icon-choice {
  width: 40px;
  height: 40px;
  background: #ffffff;
  color: #07182b;
  font-size: 1.05rem;
  font-weight: 900;
}

.color-choice.is-selected,
.icon-choice.is-selected {
  border-color: #07182b;
  box-shadow: 0 0 0 4px #ffffff, 0 0 0 6px rgba(7, 24, 43, 0.24);
}

.icon-choice.is-selected {
  background: var(--selected-color, #7bd3ea);
}

.category-start-actions {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  border-top: 1px solid #cbd6d4;
  padding-top: 24px;
}

.category-start-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

.category-detail-screen {
  min-height: 640px;
}

.category-detail-card {
  display: grid;
  gap: 16px;
  border: 1px solid var(--line);
  border-top: 5px solid var(--brand);
  border-radius: 8px;
  background: #fbfcfc;
  padding: 14px;
}

.category-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.category-detail-header h3 {
  margin-bottom: 5px;
  border-left: 0;
  padding-left: 0;
}

.category-detail-header p {
  margin-bottom: 0;
  color: var(--muted);
}

.category-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.entity-menu {
  position: relative;
}

.entity-menu-button {
  min-width: 42px;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: #e8eeee;
  color: #263533;
  cursor: pointer;
  font-weight: 900;
}

.entity-menu-list {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  display: none;
  min-width: 150px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 38px rgba(24, 35, 34, 0.16);
}

.entity-menu-list.is-open {
  display: grid;
}

.entity-menu-list button {
  min-height: 40px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  color: #263533;
  cursor: pointer;
  font-weight: 800;
  padding: 10px 12px;
  text-align: left;
}

.entity-menu-list button:last-child {
  border-bottom: 0;
}

.entity-menu-list button:hover {
  background: #eef3f2;
}

.category-detail-settings {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 10px;
}

.capture-guidance {
  display: grid;
  gap: 8px;
  border: 1px solid #d6dedc;
  border-left: 5px solid #8a9693;
  border-radius: 8px;
  background: #ffffff;
  color: #31413f;
  padding: 14px;
}

.capture-guidance strong {
  color: #07182b;
}

.capture-guidance p {
  margin: 0;
}

.ultimate-vision-field {
  gap: 10px;
  color: #07182b;
  font-size: 1.25rem;
  font-weight: 900;
}

.ultimate-vision-field textarea {
  min-height: 150px;
  border-width: 2px;
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1.25;
}

.category-prompts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 14px;
}

.category-prompts textarea {
  min-height: 160px;
}

.category-planning-title {
  margin: 8px 0 0;
  border-left: 0;
  color: #07182b;
  font-size: 1.05rem;
  padding-left: 0;
}

.category-detail-card h4 {
  margin: 4px 0 0;
  color: #31413f;
}

.category-detail-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.category-detail-list span {
  border: 1px solid #d6dedc;
  border-radius: 999px;
  background: #eef3f2;
  color: #31413f;
  font-size: 0.84rem;
  font-weight: 800;
  padding: 6px 10px;
}

.detail-chip-button {
  border: 1px solid #d6dedc;
  border-radius: 999px;
  background: #eef3f2;
  color: #31413f;
  cursor: pointer;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 800;
  padding: 6px 10px;
}

.detail-chip-button:hover,
.detail-chip-button:focus-visible {
  border-color: #9eb6b2;
  background: #ffffff;
}

.category-detail-list .muted-text {
  border-style: dashed;
  color: var(--muted);
}

.action-detail-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.action-inline-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.action-link-button {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 0;
  text-align: left;
}

.action-link-button:hover,
.action-link-button:focus-visible {
  color: var(--brand);
  text-decoration: underline;
}

.day-detail-screen {
  min-height: 520px;
}

.day-detail-card {
  display: grid;
  gap: 16px;
}

.day-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.day-detail-header h3 {
  margin-bottom: 5px;
  border-left: 0;
  padding-left: 0;
}

.day-detail-header p {
  margin-bottom: 0;
  color: var(--muted);
}

.day-action-list {
  display: grid;
  gap: 10px;
}

.day-action-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--brand);
  border-radius: 8px;
  background: #fbfcfc;
  padding: 12px;
}

.day-action-row span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.day-action-controls {
  display: flex;
  gap: 8px;
}

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

.block-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--brand);
  border-radius: 8px;
  background: #fbfcfc;
  padding: 14px;
}

.block-card-header,
.block-add-action {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.block-card h3 {
  margin-bottom: 5px;
  border-left: 0;
  padding-left: 0;
}

.block-card p,
.block-body span {
  color: var(--muted);
}

.block-body {
  display: grid;
  gap: 4px;
}

.block-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.block-action-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #d6dedc;
  border-radius: 999px;
  background: #eef3f2;
  color: #31413f;
  font-size: 0.84rem;
  font-weight: 800;
  padding: 6px 8px 6px 10px;
}

.block-action-chip button {
  border: 0;
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  padding: 3px 7px;
}

.block-add-action select {
  min-width: min(320px, 100%);
}

.project-row {
  cursor: pointer;
}

.project-detail-card {
  min-height: 520px;
}

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

.project-attach-row,
.project-attach-controls {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
  padding: 10px;
}

.project-attach-row span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.project-attach-controls select {
  min-width: min(420px, 100%);
}

.category-form {
  display: grid;
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
}

.category-entry-form {
  gap: 14px;
  margin-bottom: 0;
}

.form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.category-entry-form textarea {
  min-height: 118px;
  line-height: 1.45;
}

.category-entry-form .featured-field textarea {
  min-height: 140px;
  font-size: 1rem;
}

.category-entry-form input[type="color"] {
  min-height: 46px;
}

.category-entry-form .primary-button {
  margin-top: 2px;
}

.category-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.9fr);
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.category-title {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.category-title i {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(24, 35, 34, 0.18);
}

.category-controls {
  display: grid;
  grid-template-columns: 42px 56px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.category-add-action {
  min-height: 42px;
  border: 1px solid #cbd6d4;
  border-radius: 8px;
  background: #f6f8f8;
  color: var(--brand);
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: 900;
}

.category-add-action:hover {
  background: #e7f1ee;
}

.category-delete {
  min-height: 42px;
}

.category-row span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.85rem;
}

.actions-panel {
  margin-top: 18px;
}

.imported-panel {
  margin-top: 18px;
}

.projects-panel {
  margin-top: 18px;
}

.calendar-panel {
  margin-top: 0;
}

.calendar-heading {
  align-items: flex-start;
}

.calendar-toolbar,
.calendar-mode-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.calendar-mode-tabs {
  margin-bottom: 14px;
}

.calendar-mode {
  min-height: 38px;
  border: 1px solid #cbd6d4;
  border-radius: 8px;
  background: #f6f8f8;
  color: #31413f;
  cursor: pointer;
  font-weight: 800;
  padding: 8px 12px;
}

.calendar-mode.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
}

.calendar-title {
  margin-bottom: 14px;
  border-left: 0;
  padding-left: 0;
}

.calendar-list {
  display: grid;
  gap: 10px;
}

.calendar-item {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: 8px;
  background: #fbfcfc;
  padding: 10px;
  cursor: pointer;
}

.calendar-item:focus-visible {
  outline: 3px solid rgba(63, 110, 167, 0.22);
  outline-offset: 2px;
}

.calendar-item span {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.calendar-item.is-compact {
  padding: 7px;
}

.calendar-item.is-compact strong {
  font-size: 0.84rem;
}

.calendar-item.is-compact span {
  font-size: 0.76rem;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.calendar-weekday-header {
  min-height: 38px;
  background: #eef3f2;
  color: #31413f;
  font-size: 0.82rem;
  font-weight: 900;
  padding: 10px;
  text-align: center;
}

.calendar-grid-cell {
  min-width: 0;
  background: rgba(251, 252, 252, 0.94);
  padding: 9px;
  outline: 1px solid var(--line);
}

.calendar-grid-cell h4 {
  margin: 0 0 8px;
  color: #31413f;
  font-size: 0.88rem;
}

.calendar-grid-cell.is-today {
  background: #eef8f5;
  box-shadow: inset 0 0 0 2px rgba(18, 108, 92, 0.24);
}

.calendar-mini-list {
  display: grid;
  gap: 6px;
}

.calendar-empty,
.calendar-more {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.month-view .calendar-grid-cell {
  min-height: 128px;
}

.week-view .calendar-grid-cell {
  min-height: 260px;
}

.calendar-grid-cell.is-muted {
  opacity: 0.46;
}

.action-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfc;
}

.must-do-field {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 8px;
  border: 1px solid #d6dedc;
  border-radius: 999px;
  background: #ffffff;
  cursor: pointer;
  padding: 7px 12px;
}

.must-do-field input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.must-do-field span {
  color: #8a9693;
  font-size: 1.1rem;
  line-height: 1;
}

.must-do-field.is-active {
  border-color: #d99636;
  background: #fff6df;
}

.must-do-field.is-active span {
  color: #d99636;
}

.must-do-star {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-right: 6px;
  border: 1px solid #d6dedc;
  border-radius: 999px;
  background: #ffffff;
  color: #8a9693;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  vertical-align: middle;
}

.must-do-star.is-active {
  border-color: #d99636;
  background: #fff6df;
  color: #d99636;
}

.must-do-star:hover,
.must-do-star:focus-visible {
  border-color: #aebeba;
  outline: 3px solid rgba(63, 110, 167, 0.18);
  outline-offset: 1px;
}

.calendar-item .must-do-star,
.day-action-row .must-do-star,
.project-attach-row .must-do-star {
  width: 26px;
  height: 26px;
  margin-right: 5px;
}

.imported-events {
  display: grid;
  gap: 10px;
}

.project-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
}

.person-form {
  display: grid;
  gap: 12px;
}

.project-form button {
  grid-column: 1 / -1;
}

.project-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfc;
}

.project-row h3 {
  margin-bottom: 5px;
  border-left: 0;
  padding-left: 0;
}

.project-row p {
  margin-bottom: 0;
  color: var(--muted);
}

.imported-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(290px, 0.75fr);
  gap: 14px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfc;
}

.imported-details p {
  color: var(--muted);
  margin-bottom: 0;
}

.assignment-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px;
  gap: 10px;
  align-items: end;
}

.assignment-controls .assign-button {
  grid-column: 1 / -1;
}

.action-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.action-main p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.4;
}

.action-assignment {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.8fr) auto;
  gap: 10px;
  align-items: end;
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.action-assignment button {
  min-height: 42px;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 5px 10px;
  font-size: 0.82rem;
  font-weight: 800;
}

.category-pill {
  background: #e7f1ee;
  color: var(--brand-dark);
}

.calendar-pill {
  background: #fff2df;
  color: #7b4b0f;
}

.project-pill {
  background: #edf1f6;
  color: #34526f;
}

.source-pill {
  background: #eef0f0;
  color: #3c4947;
}

.unassigned-pill {
  background: #eef0f0;
  color: #5e6b69;
  border-color: #d6dedc;
}

.empty {
  border: 1px dashed #bdc9c7;
  border-radius: 8px;
  color: var(--muted);
  padding: 18px;
  text-align: center;
}

@media (max-width: 1180px) {
  .tile-board-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }

  .category-prompts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 780px) {
  .shell {
    width: min(100% - 22px, 1120px);
    padding: 18px 0;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding-right: 0;
    margin-top: 58px;
  }

  .topbar-actions,
  .create-menu {
    width: 100%;
  }

  .topbar-actions button:not(.profile-button) {
    width: 100%;
  }

  .settings-sidebar {
    width: 100vw;
    padding: 16px;
  }

  .grid,
  .workspace-layout,
  .two-col,
  .three-col,
  .repeat-grid,
  .appearance-controls,
  .category-form,
  .form-row,
  .project-form,
  .category-row,
  .imported-card {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 15px;
  }

  .action-main {
    flex-direction: column;
  }

  .action-assignment {
    grid-template-columns: 1fr;
  }

  .calendar-heading {
    flex-direction: column;
  }

  .category-detail-header {
    flex-direction: column;
  }

  .day-detail-header,
  .day-action-row,
  .project-attach-row,
  .project-attach-controls,
  .block-card-header,
  .block-add-action {
    flex-direction: column;
  }

  .category-detail-actions,
  .category-detail-settings,
  .category-prompts {
    width: 100%;
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .day-action-controls {
    width: 100%;
  }

  .day-action-controls button {
    flex: 1;
  }

  .category-board-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .create-category-button {
    justify-content: center;
    width: 100%;
  }

  .tile-board-grid {
    grid-template-columns: 1fr;
  }

  .week-view,
  .month-view {
    grid-template-columns: 1fr;
  }

  .calendar-weekday-header {
    display: none;
  }

  .calendar-grid-cell,
  .week-view .calendar-grid-cell,
  .month-view .calendar-grid-cell {
    min-height: auto;
  }

  .project-row {
    flex-direction: column;
  }
}
