/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

:root {
  color-scheme: light;
  --background: #f7f7f4;
  --surface: #ffffff;
  --surface-muted: #f0f2f5;
  --text: #1f2933;
  --muted: #626e7a;
  --border: #d9dee5;
  --accent: #b9412f;
  --accent-dark: #8f2f22;
  --focus: #2f6fed;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: clip;
  background: var(--background);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
}

.auth-shell,
.page-shell {
  width: min(100% - 32px, 960px);
  margin: 0 auto;
}

.auth-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
}

.auth-panel,
.dashboard-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 18px 45px rgb(31 41 51 / 8%);
}

.auth-panel {
  width: min(100%, 420px);
  padding: 32px;
}

.page-shell {
  padding: 64px 0;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 6vw, 3.5rem);
  line-height: 1.05;
}

h2 {
  margin-bottom: 8px;
  font-size: 1.2rem;
}

.auth-form {
  display: grid;
  gap: 18px;
  margin-top: 28px;
}

.oauth-consent {
  max-width: 620px;
}

.oauth-consent-intro {
  margin-top: 14px;
  color: var(--muted);
}

.oauth-scope-list {
  display: grid;
  gap: 10px;
  margin: 22px 0;
}

.oauth-scope-list > div {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--surface-muted);
}

.oauth-scope-list p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.oauth-consent-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.field {
  display: grid;
  gap: 6px;
}

label {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
}

input[type="email"],
input[type="password"],
input[type="text"],
input[type="search"],
input[type="date"],
input[type="number"],
textarea,
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 14px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
}

/* iOS zooms the viewport when a focused form control is rendered below 16px. */
@media (max-width: 768px) {
  input[type="email"],
  input[type="password"],
  input[type="text"],
  input[type="search"],
  input[type="date"],
  input[type="number"],
  textarea,
  select {
    font-size: 16px !important;
  }
}

textarea {
  resize: vertical;
}

input:focus-visible,
.button:focus-visible,
.page-tab:focus-visible,
.brand-link:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus), transparent 65%);
  outline-offset: 2px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 44px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 10px 16px;
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
}

.button:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.button:disabled {
  border-color: var(--border);
  background: var(--surface-muted);
  color: var(--muted);
  cursor: not-allowed;
}

.button-secondary {
  background: var(--surface);
  color: var(--accent);
}

.button-secondary:hover {
  background: #fff6f3;
  color: var(--accent-dark);
}

.button-danger {
  border-color: #b42318;
  background: #b42318;
  color: #ffffff;
}

.button-danger:hover {
  border-color: #8f1d14;
  background: #8f1d14;
}

.notification-card {
  max-width: 680px;
  padding: 28px;
}

.notifications-page {
  width: min(100% - 32px, 1120px);
}

.notifications-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(360px, 1.15fr);
  gap: 20px;
  align-items: start;
}

.notifications-grid .notification-card {
  max-width: none;
}

.notification-form {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.notification-form small,
.notification-history-item small {
  color: var(--muted);
}

.notification-delivery-options {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  border: 0;
  padding: 0;
}

.notification-delivery-options legend {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
}

.notification-delivery-options label {
  color: var(--text);
}

.recurrence-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px;
  gap: 16px;
  align-items: end;
}

.notification-weekdays {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  border: 0;
  padding: 0;
}

.notification-weekdays legend {
  width: 100%;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
}

.notification-weekdays label {
  cursor: pointer;
}

.notification-weekdays input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.notification-weekdays span {
  display: inline-flex;
  min-width: 45px;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.notification-weekdays input:checked + span {
  border-color: var(--accent);
  background: #fff6f3;
  color: var(--accent-dark);
}

.notification-weekdays input:focus-visible + span {
  outline: 3px solid color-mix(in srgb, var(--focus), transparent 65%);
  outline-offset: 2px;
}

.notification-history {
  margin-top: 20px;
}

.notification-list {
  display: grid;
  gap: 0;
  margin-top: 18px;
}

.notification-history-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid var(--border);
  padding: 16px 0;
}

.notification-history-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.notification-history-item p {
  margin: 4px 0;
}

.notification-history-heading {
  display: flex;
  align-items: center;
  gap: 10px;
}

.notification-status {
  border-radius: 999px;
  padding: 3px 8px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.notification-status-sent {
  background: #edf7ee;
  color: #176b31;
}

.notification-status-failed,
.notification-status-cancelled,
.notification-error {
  color: #9b1c1c;
}

.notification-status-failed,
.notification-status-cancelled {
  background: #fff1f1;
}

.notification-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px 0 0;
}

.notification-help {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.notifications-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.notifications-intro {
  margin: 10px 0 0;
  color: var(--muted);
}

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

.notification-settings-grid .notification-card {
  max-width: none;
}

.notification-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.device-status,
.notification-count,
.notification-source {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
}

.device-status[data-state="enabled"] {
  background: #edf7ee;
  color: #176b31;
}

.device-status[data-state="disabled"],
.device-status-paused {
  background: #fff4df;
  color: #8a5a00;
}

.device-status[data-state="unavailable"] {
  background: #fff1f1;
  color: #9b1c1c;
}

.eod-reminder-card form {
  margin-top: 20px;
}

.text-link-button {
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 750;
}

.text-link-button:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}

.text-link-button.danger {
  color: #9b1c1c;
}

.notification-compose-card {
  margin-top: 20px;
}

.sleep-notification-card {
  margin-top: 20px;
}

.sleep-next-stage {
  margin: 12px 0 0;
}

.sleep-device-warning {
  border-left: 3px solid #8a5a00;
  padding-left: 12px;
}

.sleep-routine-form {
  display: grid;
  gap: 20px;
  margin-top: 22px;
}

.sleep-stage-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.sleep-stage-card {
  display: grid;
  min-width: 0;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
}

.sleep-stage-card legend {
  padding: 0 6px;
  font-weight: 800;
}

.sleep-stage-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.sleep-routine-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.sleep-routine-actions form {
  margin: 0;
}

.notification-section-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--border);
}

.notification-section-tab {
  min-height: 44px;
  padding: 11px 16px;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  font-weight: 800;
  text-decoration: none;
}

.notification-section-tab:hover,
.notification-section-tab.active {
  border-bottom-color: var(--accent);
  color: var(--text);
}

.notification-daily-summary,
.notification-history-panel {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.notification-card-list,
.notification-history-rows {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.notification-schedule-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, auto) auto;
  gap: 18px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 17px;
  background: #fff;
}

.notification-schedule-main,
.notification-history-summary > div {
  min-width: 0;
}

.notification-schedule-main p,
.notification-history-summary p {
  overflow-wrap: anywhere;
  margin: 6px 0 0;
  color: var(--muted);
}

.notification-history-heading > div {
  display: grid;
  min-width: 0;
}

.notification-history-heading > div small {
  color: var(--muted);
}

.notification-category-mark {
  display: inline-flex;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: var(--surface-muted);
  font-size: 1.3rem;
}

.notification-next-send {
  display: grid;
  gap: 2px;
}

.notification-next-send > span,
.notification-next-send small {
  color: var(--muted);
  font-size: 0.76rem;
}

.notification-next-send strong {
  font-size: 1rem;
}

.notification-secondary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 20px;
}

.notification-device-disclosure > summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}

.notification-device-disclosure > summary strong,
.notification-compose-card .section-heading h2 {
  display: block;
  margin: 2px 0 0;
}

.notification-device-content {
  margin-top: 18px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.notification-device-list-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
}

.notification-empty-state {
  margin-top: 18px;
  border: 1px dashed var(--border);
  border-radius: 9px;
  padding: 22px;
  background: var(--surface-muted);
}

.notification-empty-state p {
  margin: 6px 0 14px;
  color: var(--muted);
}

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

.notification-history-filters {
  display: grid;
  grid-template-columns: 150px minmax(180px, 220px) minmax(220px, 1fr) auto;
  gap: 10px;
  margin-top: 18px;
}

.notification-history-row {
  border-top: 1px solid var(--border);
  padding: 16px 0;
}

.notification-history-row:first-child {
  border-top: 0;
}

.notification-history-summary {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.notification-technical-details {
  margin: 12px 0 0 50px;
}

.notification-technical-details summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.notification-technical-details dl {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
}

.notification-technical-details dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.notification-technical-details dd {
  margin: 2px 0 0;
}

.notification-history-row > .notification-item-actions {
  margin: 10px 0 0 50px;
  justify-content: flex-start;
}

.sleep-stage-schedules {
  margin-top: 20px;
}

.notification-compose-card > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  list-style: none;
}

.notification-compose-card > summary::-webkit-details-marker {
  display: none;
}

.notification-compose-card > summary strong {
  display: block;
  font-size: 1.2rem;
}

.notification-compose-card[open] > summary .button {
  display: none;
}

.notification-form-actions,
.notification-toolbar,
.notification-filters,
.notification-search,
.notification-item-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.notification-management {
  margin-top: 24px;
}

.notification-toolbar {
  justify-content: space-between;
  gap: 16px;
}

.notification-filters {
  gap: 6px;
}

.notification-filter {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 7px 12px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 750;
  text-decoration: none;
}

.notification-filter:hover,
.notification-filter.active {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text);
}

.notification-search {
  flex-wrap: nowrap;
}

.notification-search input[type="search"] {
  width: min(300px, 45vw);
}

.notification-message-content {
  min-width: 0;
  flex: 1;
}

.notification-metadata {
  display: grid;
  grid-template-columns: repeat(5, minmax(110px, 1fr));
  gap: 10px;
  margin: 14px 0 0;
}

.notification-metadata div {
  min-width: 0;
}

.notification-metadata dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
  text-transform: uppercase;
}

.notification-metadata dd {
  overflow-wrap: anywhere;
  margin: 2px 0 0;
  font-size: 0.84rem;
}

.notification-item-actions {
  align-items: flex-start;
  justify-content: flex-end;
}

.notification-item-actions form {
  margin: 0;
}

.notification-item-actions .text-link {
  color: var(--accent);
  font-size: 0.82rem;
}

.notification-status-paused {
  background: #fff4df;
  color: #8a5a00;
}

.notification-source {
  padding: 2px 7px;
  background: #eef4ff;
  color: #2f5d9b;
}

.flash {
  margin-top: 18px;
  border-radius: 6px;
  padding: 10px 12px;
  font-weight: 650;
}

.flash-alert {
  background: #fff1f1;
  color: #9b1c1c;
}

.flash-notice {
  background: #edf7ee;
  color: #176b31;
}

.connections-page {
  display: grid;
  gap: 22px;
}

.connection-token-reveal {
  display: grid;
  gap: 14px;
  border: 1px solid #b7dfc0;
  border-radius: 8px;
  padding: 18px;
  background: #edf7ee;
}

.connection-token-reveal h2 {
  margin: 0;
}

.connection-token-reveal p {
  margin: 4px 0 0;
  color: var(--muted);
}

.connection-secret-block {
  display: grid;
  gap: 6px;
}

.connection-secret-block label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.connection-secret-block input,
.connection-config-list code {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  background: #ffffff;
  color: var(--text);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.86rem;
}

.connection-scope-list,
.connection-config-list,
.connection-token-list {
  display: grid;
  gap: 10px;
}

.connection-scope {
  align-items: flex-start;
  display: flex;
  gap: 10px;
}

.connection-scope input {
  margin-top: 3px;
}

.connection-scope span {
  display: grid;
  gap: 3px;
}

.connection-scope small,
.connection-config-list span,
.connection-token-list p {
  color: var(--muted);
  font-size: 0.86rem;
}

.connection-config-list > div {
  display: grid;
  gap: 6px;
}

.connection-token-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.connection-token-list li {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  background: var(--surface-muted);
}

.connection-token-list li.is-revoked {
  opacity: 0.72;
}

.connection-token-list p {
  margin: 5px 0 0;
}

@media (max-width: 720px) {
  .connection-token-list li {
    align-items: stretch;
    flex-direction: column;
  }

  .connection-token-list .button_to,
  .connection-token-list .button {
    width: 100%;
  }
}

.top-menu {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--border);
  background: rgb(255 255 255 / 94%);
  backdrop-filter: blur(12px);
}

.top-menu-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(100% - 32px, 1120px);
  min-height: 64px;
  margin: 0 auto;
}

.brand-link {
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.page-tabs {
  display: flex;
  align-self: stretch;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
}

.page-tab {
  display: inline-flex;
  align-items: center;
  border-bottom: 3px solid transparent;
  padding: 0 18px;
  color: var(--muted);
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

.page-tab:hover,
.page-tab-active {
  border-bottom-color: var(--accent);
  color: var(--text);
}

.navigation-more {
  position: relative;
  display: flex;
  align-self: stretch;
}

.navigation-more > summary {
  cursor: pointer;
  height: 100%;
  list-style: none;
}

.navigation-more > summary::-webkit-details-marker {
  display: none;
}

.navigation-more > summary::after {
  content: "▾";
  margin-left: 7px;
  font-size: 0.72em;
}

.navigation-more[open] > summary,
.navigation-more.page-tab-active > summary {
  border-bottom-color: var(--accent);
  color: var(--text);
}

.navigation-more-menu {
  position: absolute;
  top: calc(100% - 6px);
  right: 0;
  display: grid;
  min-width: 190px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: white;
  padding: 8px;
  box-shadow: 0 14px 35px rgb(31 41 55 / 16%);
}

.navigation-more-link {
  border-radius: 7px;
  padding: 11px 12px;
  color: var(--muted);
  font-weight: 700;
  text-decoration: none;
}

.navigation-more-link:hover,
.navigation-more-link:focus-visible,
.navigation-more-link-active {
  background: var(--surface-muted);
  color: var(--text);
}

.account-actions {
  border-left: 1px solid var(--border);
  padding-left: 20px;
}

.placeholder-copy {
  margin-top: 18px;
  color: var(--muted);
  font-size: 1.1rem;
}

.tab {
  border-radius: 6px;
  padding: 10px 14px;
  color: var(--muted);
  font-weight: 700;
  text-decoration: none;
}

.tab:hover,
.tab-active {
  background: var(--surface);
  color: var(--text);
}

.tab-content {
  display: grid;
  gap: 1px;
  background: var(--border);
}

.placeholder-section {
  background: var(--surface);
  padding: 28px;
}

.dashboard-page {
  width: min(100% - 32px, 1180px);
}

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

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

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 20px;
  align-items: start;
}

.dashboard-section {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: 20px;
  box-shadow: 0 16px 38px rgb(31 41 51 / 6%);
}

.dashboard-section h2,
.dashboard-project-card h3 {
  margin: 0;
}

.dashboard-section time {
  display: block;
  margin-top: 4px;
  font-size: 0.9rem;
}

.dashboard-eod-copy {
  min-height: 360px;
  margin-top: 16px;
  border-color: var(--border);
  background: #fbfbf9;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  line-height: 1.55;
}

.dashboard-project-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.recent-tickets-section {
  grid-column: 1 / -1;
}

.section-hint,
.ticket-age-filter {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.dashboard-ticket-list {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.dashboard-ticket-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 11px 12px;
  background: var(--surface-muted);
}

.dashboard-ticket-row strong,
.dashboard-ticket-row span {
  display: block;
}

.dashboard-ticket-row span,
.dashboard-ticket-row time {
  color: var(--muted);
  font-size: 0.78rem;
}

.dashboard-project-card {
  display: grid;
  gap: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
  padding: 16px;
}

.dashboard-project-card h3 {
  font-size: 1rem;
  line-height: 1.35;
}

.dashboard-project-card p {
  margin: 5px 0 0;
  color: var(--muted);
}

.dashboard-project-card h3,
.dashboard-project-card p,
.project-card h2,
.project-card-header p,
.kanban-ticket h4,
.ticket-summary {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
}

.dashboard-project-card h3,
.project-card h2,
.kanban-ticket h4 {
  -webkit-line-clamp: 2;
}

.dashboard-project-card p,
.project-card-header p {
  -webkit-line-clamp: 2;
}

.dashboard-project-card h3,
.project-card h2 {
  min-height: 2.7em;
}

.dashboard-project-card p,
.project-card-header p {
  min-height: 3em;
}

.topbar,
.projects-hero,
.project-card-header,
.project-card-actions,
.project-overview-heading,
.section-heading,
.ticket-title-row,
.ticket-move-actions {
  display: flex;
  align-items: center;
}

.topbar,
.projects-hero,
.project-card-header,
.project-overview-heading,
.section-heading,
.ticket-title-row {
  justify-content: space-between;
  gap: 18px;
}

.topbar {
  margin-bottom: 28px;
}

.project-card-header > div {
  min-width: 0;
}

.text-link {
  color: var(--accent);
  font-weight: 750;
  text-decoration: none;
}

.text-link:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}

.projects-page,
.project-show-page,
.project-form-page {
  width: min(100% - 32px, 1180px);
}

.projects-hero {
  position: relative;
  margin-bottom: 28px;
}

.projects-hero h1 {
  max-width: 820px;
  font-size: clamp(2rem, 4vw, 3.1rem);
}

.project-new-button {
  align-self: flex-start;
  white-space: nowrap;
}

.project-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

.project-card,
.project-overview,
.kanban-section,
.empty-projects,
.project-form,
.ticket-detail {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 16px 38px rgb(31 41 51 / 6%);
}

.project-card {
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 22px;
  padding: 22px;
}

.project-card-archived {
  opacity: 0.72;
}

.project-card h2,
.project-overview h2,
.kanban-section h2,
.kanban-column h3,
.kanban-ticket h4,
.ticket-detail h2,
.empty-projects h2 {
  margin: 0;
}

.project-card h2 {
  font-size: 1.15rem;
}

.project-card p,
.project-overview p,
.empty-projects p {
  margin: 6px 0 0;
  color: var(--muted);
}

.project-status,
.priority-badge,
.count-badge,
.ticket-labels span,
.ticket-detail-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.project-status::before {
  width: 8px;
  height: 8px;
  margin-right: 7px;
  border-radius: 999px;
  background: currentColor;
  content: "";
}

.status-active {
  background: #edf7ee;
  color: #176b31;
}

.status-planning {
  background: #fff7df;
  color: #806000;
}

.status-paused {
  background: #eef4ff;
  color: #2557a7;
}

.status-complete {
  background: #f0f2f5;
  color: #3d4852;
}

.status-archived {
  background: #f4eeee;
  color: #7c3f3f;
}

.project-card-metrics,
.detail-list,
.progress-metrics {
  display: grid;
  gap: 12px;
  margin: 0;
}

.project-card-metrics {
  grid-template-columns: repeat(3, 1fr);
}

.project-card-metrics div,
.progress-metrics div,
.detail-list div {
  min-width: 0;
}

dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  text-transform: uppercase;
}

dd {
  margin: 2px 0 0;
  font-weight: 800;
}

.project-card-actions {
  align-self: end;
  flex-wrap: wrap;
  gap: 10px;
}

.empty-projects {
  padding: 36px;
}

.project-overview,
.kanban-section {
  padding: 26px;
}

.project-overview {
  margin-bottom: 22px;
}

.project-overview-heading {
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
}

.project-overview h1 {
  font-size: clamp(2rem, 4vw, 3rem);
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 24px;
  padding-top: 24px;
}

.overview-grid section {
  min-width: 0;
}

.progress-metrics {
  grid-template-columns: repeat(3, 1fr);
}

.progress-bar {
  height: 10px;
  margin-top: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-muted);
}

.progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

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

.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 18px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.kanban-mobile-tabs {
  display: none;
}

.kanban-column {
  min-width: 220px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
  padding: 14px;
}

.kanban-column.drag-over {
  border-color: var(--accent);
  background: #fff6f3;
}

.kanban-column h3 {
  margin-bottom: 12px;
  font-size: 0.96rem;
}

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

.kanban-ticket {
  position: relative;
  display: grid;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
}

.kanban-ticket:hover {
  border-color: color-mix(in srgb, var(--accent), var(--border) 55%);
  box-shadow: 0 10px 24px rgb(31 41 51 / 8%);
}

.kanban-ticket.dragging {
  opacity: 0.45;
}

.kanban-ticket-open-link {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 8px;
  color: inherit;
  overflow: hidden;
  text-indent: -9999px;
  white-space: nowrap;
  text-decoration: none;
}

.kanban-ticket-open-link:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus), transparent 65%);
  outline-offset: 2px;
}

.kanban-ticket h4 {
  min-width: 0;
  min-height: 2.6em;
  font-size: 0.95rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.ticket-summary {
  min-height: 4.5em;
  line-height: 1.5;
  -webkit-line-clamp: 3;
}

.kanban-ticket p,
.kanban-ticket time {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.ticket-status-tag {
  display: none;
}

.priority-badge,
.count-badge,
.ticket-labels span,
.ticket-detail-tags span {
  background: #eef1f4;
  color: #48525e;
}

.priority-high,
.priority-urgent {
  background: #fff1f1;
  color: #9b1c1c;
}

.priority-low {
  background: #edf7ee;
  color: #176b31;
}

.ticket-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ticket-title-row,
.ticket-summary,
.ticket-labels,
.kanban-ticket time {
  pointer-events: none;
}

.ticket-move-actions {
  position: relative;
  z-index: 2;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 8px;
}

.ticket-show-page {
  width: min(100% - 32px, 860px);
}

.ticket-detail {
  display: grid;
  gap: 22px;
  padding: 26px;
}

.ticket-detail-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.ticket-detail h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  overflow-wrap: anywhere;
}

.ticket-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ticket-detail .ticket-status-tag {
  display: inline-flex;
}

.ticket-detail-section p {
  margin: 8px 0 0;
  color: var(--muted);
  white-space: pre-wrap;
}

.ticket-detail-meta {
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.tiny {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 0.8rem;
}

.project-form {
  display: grid;
  gap: 18px;
  margin-top: 24px;
  padding: 26px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 100px 180px;
  gap: 18px;
}

.form-errors {
  border-radius: 8px;
  background: #fff1f1;
  padding: 14px 18px;
  color: #9b1c1c;
}

.form-errors h2 {
  font-size: 1rem;
}

.form-errors ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

@media (max-width: 820px) {
  .top-menu-inner,
  .projects-hero,
  .project-overview-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .page-tabs {
    width: 100%;
    overflow: visible;
  }

  .page-tab {
    min-height: 44px;
  }

  .account-actions {
    width: 100%;
    border-top: 1px solid var(--border);
    border-left: 0;
    padding-top: 12px;
    padding-left: 0;
  }

  .project-card-metrics,
  .overview-grid,
  .progress-metrics,
  .compact-list,
  .form-grid,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .project-new-button {
    width: 100%;
  }
}

.placeholder-section p {
  margin-bottom: 0;
  color: var(--muted);
}

@media (max-width: 720px) {
  .auth-shell,
  .page-shell,
  .dashboard-page,
  .notifications-page,
  .projects-page,
  .project-show-page,
  .project-form-page,
  .ticket-show-page {
    width: min(100% - 20px, 100%);
  }

  .page-shell {
    padding: 28px 0;
  }

  .notifications-grid {
    grid-template-columns: 1fr;
  }

  .recurrence-fields {
    grid-template-columns: 1fr;
  }

  .notification-history-item {
    flex-direction: column;
  }

  .notification-history-item form,
  .notification-history-item .button {
    width: 100%;
  }

  .notifications-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .notifications-hero > .button,
  .notification-search,
  .notification-search input[type="search"] {
    width: 100%;
  }

  .notification-settings-grid,
  .sleep-stage-grid,
  .notification-secondary-grid,
  .notification-compose-grid,
  .notification-metadata {
    grid-template-columns: 1fr;
  }

  .notification-schedule-card,
  .notification-history-summary,
  .notification-history-filters {
    grid-template-columns: minmax(0, 1fr);
  }

  .notification-schedule-card .notification-item-actions {
    justify-content: flex-start;
  }

  .notification-history-summary .notification-category-mark {
    grid-row: 1;
  }

  .notification-technical-details,
  .notification-history-row > .notification-item-actions {
    margin-left: 0;
  }

  .notification-section-tabs {
    overflow-x: auto;
  }

  .notification-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .notification-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .notification-item-actions {
    justify-content: flex-start;
  }

  .top-menu-inner {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
    padding: 14px 0;
  }

  .page-tabs {
    order: 3;
    overflow: visible;
  }

  .page-tab {
    min-height: 44px;
    padding: 0 14px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
  }

  .topbar .button,
  .section-heading .button {
    width: 100%;
  }

  .project-overview,
  .kanban-section,
  .project-form,
  .ticket-detail {
    padding: 16px;
  }

  .project-overview {
    margin-bottom: 14px;
  }

  .project-overview-heading {
    gap: 12px;
    padding-bottom: 16px;
  }

  .project-overview h1 {
    font-size: 1.8rem;
    line-height: 1.15;
    overflow-wrap: anywhere;
  }

  .ticket-detail-heading {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
    padding-bottom: 14px;
  }

  .ticket-detail h1 {
    font-size: 1.8rem;
    line-height: 1.15;
  }

  .overview-grid {
    gap: 16px;
    padding-top: 16px;
  }

  .overview-grid section {
    border-top: 1px solid var(--border);
    padding-top: 14px;
  }

  .overview-grid section:first-child {
    border-top: 0;
    padding-top: 0;
  }

  .section-heading {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .section-heading .project-card-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .kanban-mobile-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 16px;
  }

  .kanban-tab-input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .kanban-tab-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 42px;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 10px;
    background: var(--surface);
    color: var(--muted);
    cursor: pointer;
    font-size: 0.86rem;
    font-weight: 800;
  }

  .kanban-tab-label span:last-child {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    min-height: 24px;
    border-radius: 999px;
    background: var(--surface-muted);
    color: var(--text);
    font-size: 0.78rem;
  }

  .kanban-tab-input:checked + .kanban-tab-label {
    border-color: var(--accent);
    background: #fff6f3;
    color: var(--accent-dark);
  }

  .kanban-tab-input:focus-visible + .kanban-tab-label {
    outline: 3px solid color-mix(in srgb, var(--focus), transparent 65%);
    outline-offset: 2px;
  }

  .kanban-board {
    display: block;
    margin-top: 12px;
    overflow: visible;
    padding-bottom: 0;
  }

  .kanban-column {
    min-width: 0;
    padding: 10px;
  }

  .kanban-section:has(#kanban-tab-backlog:checked) .kanban-column:not([data-kanban-status-key="backlog"]),
  .kanban-section:has(#kanban-tab-todo:checked) .kanban-column:not([data-kanban-status-key="todo"]),
  .kanban-section:has(#kanban-tab-in-progress:checked) .kanban-column:not([data-kanban-status-key="in-progress"]),
  .kanban-section:has(#kanban-tab-done:checked) .kanban-column:not([data-kanban-status-key="done"]) {
    display: none;
  }

  .kanban-column h3 {
    display: none;
  }

  .kanban-ticket {
    gap: 8px;
    padding: 11px;
  }

  .ticket-title-row {
    align-items: flex-start;
    gap: 10px;
  }

  .kanban-ticket h4 {
    min-height: 0;
    font-size: 0.92rem;
    line-height: 1.3;
  }

  .ticket-summary,
  .kanban-ticket time {
    display: none;
  }

  .ticket-move-actions {
    display: none;
  }

  .ticket-status-tag {
    display: inline-flex;
  }

  .ticket-labels {
    gap: 5px;
  }

  .priority-badge,
  .ticket-labels span {
    min-height: 24px;
    padding: 3px 8px;
    font-size: 0.72rem;
  }
}

.eod-page {
  width: min(1180px, calc(100vw - 32px));
  padding: 28px 0;
}

.eod-page.narrow {
  width: min(780px, calc(100vw - 32px));
}

.eod-dashboard {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
  min-width: 0;
}

.eod-page h2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 14px;
}

.eod-subtle,
.empty-state,
time {
  color: var(--muted);
}

.eod-panel {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: 16px;
  box-shadow: 0 18px 45px rgb(31 41 51 / 6%);
}

.eod-dashboard-actions,
.actions,
.topbar,
.eod-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.eod-dashboard-actions,
.topbar,
.eod-section-title {
  justify-content: space-between;
}

.topbar {
  margin-bottom: 14px;
}

.button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.button.save {
  border-color: #1d8d53;
  background: #e9f8ef;
  color: #176b31;
}

.button.ghost {
  background: transparent;
  color: var(--text);
}

.button.ghost:hover,
.text-link:hover {
  border-color: var(--accent);
  color: var(--text);
}

.text-link {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

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

.entry-list.spaced {
  margin-top: 16px;
}

.entry-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
  padding: 12px;
}

.entry-main {
  display: flex;
  min-width: 0;
  flex: 1;
  justify-content: space-between;
  gap: 14px;
  text-decoration: none;
}

.button.compact {
  min-height: 32px;
  padding: 6px 10px;
}

.button.tiny {
  min-height: 28px;
  padding: 4px 8px;
  font-size: 11px;
}

.heading-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.manual-ticket-dialog {
  width: min(92vw, 32rem);
  padding: 0;
  border: 0;
  border-radius: 1rem;
  box-shadow: 0 1.5rem 4rem rgb(0 0 0 / 30%);
}

.manual-ticket-dialog::backdrop {
  background: rgb(15 23 42 / 55%);
}

.manual-ticket-dialog form {
  display: grid;
  gap: 1rem;
  padding: 1.5rem;
}

.quick-ticket-dialog {
  width: min(92vw, 42rem);
}

.quick-eod-dialog {
  width: min(94vw, 58rem);
  max-height: 92vh;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: var(--background);
  box-shadow: 0 24px 70px rgb(0 0 0 / 32%);
}

.quick-eod-dialog::backdrop {
  background: rgb(15 23 42 / 58%);
}

.quick-eod-modal {
  padding: 22px;
}

.quick-eod-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.quick-eod-heading h2,
.quick-eod-heading p {
  margin-bottom: 0;
}

.quick-eod-heading > div > p:last-child {
  margin-top: 5px;
  color: var(--muted);
}

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

.quick-eod-card {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  padding: 14px;
}

.quick-eod-card h3 {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 0.9rem;
}

.quick-eod-card h3 span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
}

.quick-eod-card-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.quick-eod-card-actions .text-link {
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.quick-eod-manual-ticket {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto;
  gap: 7px;
  margin-bottom: 10px;
}

.quick-eod-manual-ticket input,
.quick-eod-manual-ticket select {
  min-width: 0;
  padding: 7px 9px;
  font-size: 0.78rem;
}

.quick-eod-manual-ticket .form-error {
  grid-column: 1 / -1;
}

.quick-eod-chips,
.quick-eod-projects {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.quick-eod-chip input,
.quick-eod-project input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.quick-eod-chip span,
.quick-eod-project span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 10px;
  background: var(--surface-muted);
  color: var(--text);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 650;
}

.quick-eod-chip input:checked + span,
.quick-eod-project input:checked + span {
  border-color: #1d8d53;
  background: #e9f8ef;
  color: #176b31;
}

.quick-eod-project span b {
  font-size: 1rem;
}

.quick-eod-list {
  display: grid;
  max-height: 210px;
  gap: 6px;
  overflow-y: auto;
}

.quick-eod-choice {
  display: flex;
  grid-template-columns: none;
  flex-direction: row;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  background: var(--surface-muted);
  color: var(--text);
  cursor: pointer;
}

.quick-eod-choice:has(input:checked) {
  border-color: #1d8d53;
  background: #e9f8ef;
}

.quick-eod-choice input {
  margin-top: 4px;
  accent-color: #1d8d53;
}

.quick-eod-choice > span,
.quick-eod-choice strong,
.quick-eod-choice small {
  display: block;
}

.quick-eod-choice > span {
  min-width: 0;
}

.quick-eod-choice strong {
  font-size: 0.8rem;
}

.quick-eod-choice small {
  margin-top: 2px;
  color: var(--muted);
  font-weight: 500;
}

.quick-eod-preview-card {
  grid-column: 1 / -1;
}

.quick-eod-preview-card form {
  display: grid;
  gap: 10px;
}

.quick-eod-preview {
  min-height: 130px;
  resize: vertical;
  font: inherit;
  font-size: 0.84rem;
}

.manual-ticket-dialog label {
  display: grid;
  gap: 0.4rem;
  font-weight: 700;
}

.manual-ticket-dialog input,
.manual-ticket-dialog select {
  width: 100%;
}

.manual-ticket-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.manual-ticket-heading h3 {
  margin: 0;
}

.dialog-close {
  border: 0;
  background: transparent;
  font-size: 1.75rem;
  cursor: pointer;
}

.form-error {
  margin: 0;
  color: #b42318;
}

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

.composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
}

.output-panel {
  grid-column: 1 / -1;
}

.day-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.day-btn,
.oneoff-btn,
.project-chip {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--text);
  cursor: pointer;
}

.day-btn {
  display: flex;
  min-width: 96px;
  flex: 1;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 6px;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.day-btn .emoji {
  font-size: 20px;
}

.oneoff-btn {
  max-width: 100%;
  padding: 8px 12px;
  font-size: 12px;
  white-space: normal;
}

.day-btn.active {
  border-color: var(--accent);
  background: #fff6f3;
  box-shadow: 0 0 0 1px var(--accent) inset;
}

.oneoff-btn.active,
.project-chip.active {
  border-color: #1d8d53;
  background: #e9f8ef;
}

.filter-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.filter-row input,
.filter-row select,
.json-input,
.prompt-text,
.output {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
}

.filter-row input,
.filter-row select {
  min-width: 0;
  min-height: 36px;
  padding: 7px 9px;
  font-size: 12px;
}

.ticket-list {
  display: flex;
  max-height: 430px;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
}

.ticket-empty {
  margin: 8px 2px;
}

.ticket-group {
  margin: 8px 2px 2px;
  color: var(--muted);
  font-size: 11px;
}

.ticket {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
  padding: 8px 10px;
}

.ticket.checked {
  border-color: var(--accent);
}

.ticket input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-top: 4px;
  accent-color: var(--accent);
}

.meta {
  min-width: 0;
  flex: 1;
}

.id-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
}

.id-tag {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
}

.status {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 6px;
  color: var(--muted);
  font-size: 10px;
}

.status.done {
  border-color: #9dd8af;
  color: #176b31;
}

.status.progress {
  border-color: #dbc46b;
  color: #705c00;
}

.summary-input {
  min-width: 0;
  width: 100%;
  border: 0;
  border-bottom: 1px dashed transparent;
  background: transparent;
  color: var(--text);
  font-size: 13px;
}

.summary-input:focus {
  border-bottom-color: var(--accent);
  outline: 0;
}

.title-full,
.word-count {
  color: var(--muted);
  font-size: 11px;
}

.title-full {
  overflow-wrap: anywhere;
}

.word-count.over {
  color: #9b1c1c;
}

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

.project-chip {
  display: flex;
  min-width: 0;
  min-height: 38px;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  font-size: 13px;
  text-align: left;
}

.project-chip span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.pe {
  font-size: 16px;
}

.count-badge {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--muted);
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 400;
}

.output,
.prompt-text,
.json-input {
  min-height: 220px;
  padding: 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  line-height: 1.65;
  resize: vertical;
}

.output,
.saved-output {
  font-family: inherit;
  font-size: 15px;
  line-height: 1.55;
}

.json-input {
  min-height: 360px;
  margin: 10px 0;
}

.prompt-box {
  margin: 18px 0 22px;
}

.prompt-text {
  min-height: 420px;
  margin-bottom: 8px;
  background: var(--surface-muted);
}

.prompt-copied {
  display: inline-block;
  min-height: 18px;
}

.saved-output {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
  padding: 16px;
  white-space: pre-wrap;
}

.copied {
  color: #176b31;
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.copied.show {
  opacity: 1;
}

.notice,
.alert {
  width: min(1180px, calc(100vw - 32px));
  margin: 16px auto 0;
  border-radius: 8px;
  padding: 10px 12px;
}

.notice {
  border: 1px solid #9dd8af;
  background: #e9f8ef;
  color: #176b31;
}

.alert {
  border: 1px solid #f0b4b4;
  background: #fff1f1;
  color: #9b1c1c;
}

@media (max-width: 860px) {
  .eod-dashboard,
  .dashboard-hero,
  .composer,
  .filter-row {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .dashboard-hero-actions,
  .quick-eod-columns {
    display: grid;
    grid-template-columns: 1fr;
  }

  .quick-eod-manual-ticket {
    grid-template-columns: 1fr;
  }

  .quick-eod-modal {
    padding: 15px;
  }

  .composer {
    display: grid;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .top-menu-inner {
    width: min(100% - 24px, 1120px);
  }

  .top-menu-inner form,
  .top-menu-inner .button {
    width: 100%;
  }

  .page-tabs {
    width: 100%;
    justify-content: space-between;
    gap: 0;
    scrollbar-width: thin;
  }

  .page-tab {
    flex: 0 0 auto;
    padding: 0 6px;
    font-size: 0.9rem;
  }

  .eod-page,
  .eod-page.narrow,
  .notice,
  .alert {
    width: min(100% - 20px, 1180px);
  }

  .eod-page {
    padding: 18px 0;
  }

  .topbar,
  .eod-dashboard,
  .eod-section-title,
  .entry-row,
  .entry-main,
  .show-heading {
    flex-wrap: wrap;
  }

  .dashboard-ticket-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .topbar {
    align-items: stretch;
    gap: 8px;
  }

  .topbar .button {
    flex: 1 1 160px;
  }

  .eod-panel {
    padding: 14px;
  }

  .eod-page h2 {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .heading-actions {
    flex: 1 1 100%;
    justify-content: flex-start;
  }

  .day-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .day-btn {
    min-width: 0;
    width: 100%;
  }

  .oneoff-btn {
    min-height: 38px;
  }

  .ticket-list {
    max-height: none;
    overflow-y: visible;
  }

  .ticket {
    padding: 9px;
  }

  .id-row {
    gap: 5px;
  }

  .actions {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .actions .button {
    flex: 1 1 140px;
  }

  .output,
  .prompt-text,
  .json-input {
    min-height: 260px;
  }
}

.device-list {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
}

.device-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid var(--border);
  padding: 14px 0;
}

.device-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.device-row small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
}

/* Learning */
.learning-page,
.learning-form-page {
  width: min(100% - 32px, 1180px);
}

.learning-hero,
.learning-card-heading,
.learning-node-heading,
.learning-card-actions {
  display: flex;
  align-items: center;
}

.learning-hero,
.learning-card-heading,
.learning-node-heading {
  justify-content: space-between;
  gap: 18px;
}

.learning-hero {
  align-items: flex-start;
  margin-bottom: 28px;
}

.learning-hero h1,
.learning-form-heading h1,
.learning-area-heading h1 {
  font-size: clamp(2rem, 4vw, 3.1rem);
}

.learning-hero p,
.learning-form-heading p,
.learning-area-overview p,
.learning-area-card > p,
.learning-node-card p,
.learning-empty-state p {
  color: var(--muted);
}

.learning-new-button {
  flex: 0 0 auto;
}

.learning-area-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
}

.learning-area-card,
.learning-area-overview,
.learning-map-section,
.learning-empty-state,
.learning-form {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 16px 38px rgb(31 41 51 / 6%);
}

.learning-area-card {
  display: grid;
  gap: 20px;
  padding: 22px;
}

.learning-area-card h2,
.learning-map-section h2,
.learning-node-card h3,
.learning-empty-state h2,
.learning-empty-state h3 {
  margin: 0;
}

.learning-area-card > p {
  margin: 0;
}

.learning-card-metrics,
.learning-node-metrics {
  display: grid;
  gap: 12px;
  margin: 0;
}

.learning-card-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.learning-current-focus {
  display: grid;
  gap: 3px;
  border-left: 3px solid var(--accent);
  padding-left: 12px;
}

.learning-current-focus span {
  color: var(--muted);
}

.learning-card-actions {
  flex-wrap: wrap;
  gap: 10px;
}

.learning-empty-state {
  padding: 36px;
}

.learning-form-heading {
  max-width: 800px;
  margin-bottom: 24px;
}

.learning-form {
  display: grid;
  gap: 18px;
  padding: 26px;
}

.learning-form .form-grid {
  grid-template-columns: minmax(240px, 1fr) 150px 150px 180px;
}

.learning-node-form-grid {
  grid-template-columns: minmax(240px, 1fr) repeat(3, 140px) !important;
}

.learning-area-overview,
.learning-map-section {
  padding: 26px;
}

.learning-area-overview {
  margin-bottom: 22px;
}

.learning-area-heading {
  align-items: flex-start;
  border-bottom: 1px solid var(--border);
  padding-bottom: 22px;
}

.learning-area-heading > div {
  min-width: 0;
}

.learning-area-heading p:last-child {
  margin: 10px 0 0;
}

.learning-overview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  padding-top: 22px;
}

.learning-overview-grid section {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px;
}

.learning-overview-grid h2 {
  margin: 0 0 6px;
}

.learning-overview-grid p {
  margin: 0;
}

.learning-focus-panel {
  border-left: 4px solid var(--accent) !important;
}

.learning-map-section .section-heading {
  margin-bottom: 20px;
}

.learning-node-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.learning-node-card {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px;
  background: var(--surface-muted);
}

.learning-node-heading {
  align-items: flex-start;
}

.learning-node-heading > div {
  min-width: 0;
}

.learning-node-heading p {
  margin: 5px 0 0;
}

.learning-node-parent {
  margin: 0 0 3px !important;
  color: var(--accent) !important;
  font-size: 0.78rem;
  font-weight: 750;
}

.mastery-meter {
  height: 8px;
  margin: 18px 0 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #dce1e7;
}

.mastery-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.learning-node-metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.learning-prerequisites {
  margin-top: 16px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.learning-prerequisites > p {
  margin: 6px 0 0;
  font-size: 0.9rem;
}

.learning-prerequisite-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}

.learning-prerequisite-list > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 5px 8px 5px 10px;
  background: #ffffff;
  font-size: 0.82rem;
  font-weight: 700;
}

.learning-prerequisite-list form {
  display: inline-flex;
}

.learning-link-remove {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-weight: 900;
}

.learning-link-remove:hover {
  background: #fbe5e2;
  color: var(--accent);
}

.learning-prerequisite-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 12px;
}


/* Even columns: unlike the skill form, no single field here deserves the width. */


.status-pending { background: #fff4e5; color: #8a5300; }
.status-accepted { background: #e6f4ea; color: #1e6b34; }
.status-rejected { background: #fbe5e2; color: #a03725; }

.learning-task-card .learning-context-block {
  margin: 12px 0 0;
  background: #ffffff;
}

.learning-context-block {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  background: var(--surface-muted);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.78rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.learning-tutor-panel {
  border-left: 4px solid #94a3b8 !important;
}

.learning-tutor-panel p {
  margin: 0 0 8px !important;
}

.learning-core-policy {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding-left: 20px;
}

.learning-core-policy li {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.learning-checkbox-field {
  align-items: center;
  display: flex;
  gap: 9px;
}

.learning-checkbox-field label {
  margin: 0;
}

.learning-control-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 12px;
}

.learning-control {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--surface-muted);
}

.learning-control label {
  display: block;
  font-size: 0.82rem;
  font-weight: 750;
  margin-bottom: 8px;
}

.learning-control input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.learning-control-scale {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
}

.learning-control-value {
  color: var(--text);
  font-weight: 800;
}

.learning-graph {
  height: 460px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
}

.learning-graph-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

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

.learning-legend-swatch {
  width: 12px;
  height: 12px;
  border: 1px solid #1f2933;
  border-radius: 3px;
}

.learning-legend-swatch.is-weak { background: #c0392b; }
.learning-legend-swatch.is-strong { background: #166534; }
.learning-legend-swatch.is-due { border: 3px double #b91c1c; background: #ffffff; }

.learning-node-card.is-focused {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px #fbe5e2;
}

.learning-node-card:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.learning-stat-band {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.learning-stat {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.learning-stat dt {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.learning-stat dd {
  margin: 6px 0 0;
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1.1;
}

.learning-stat p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.learning-stat-secondary {
  background: var(--surface-muted);
  box-shadow: none;
}

.learning-distribution {
  display: grid;
  gap: 9px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.learning-distribution li {
  align-items: center;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 34px;
  gap: 10px;
}

.learning-distribution-label {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 750;
}

.learning-distribution-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #dce1e7;
}

.learning-distribution-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.learning-distribution-count {
  font-size: 0.86rem;
  font-weight: 800;
  text-align: right;
}

.learning-trend {
  align-items: flex-end;
  display: flex;
  gap: 3px;
  height: 120px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.learning-trend-day {
  align-items: flex-end;
  display: flex;
  flex: 1;
  height: 100%;
  min-width: 0;
}

.learning-trend-bar {
  display: block;
  width: 100%;
  min-height: 2px;
  border-radius: 3px 3px 0 0;
  background: #4d7c0f;
}

.learning-trend-bar.is-down {
  background: var(--accent);
}

/* A day with nothing demonstrated should not read as a small gain. */
.learning-trend-bar.is-flat {
  background: #cbd5e1;
}

.learning-foundation-area {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.learning-history-table-wrap {
  overflow-x: auto;
}

.learning-history-table {
  border-collapse: collapse;
  width: 100%;
  min-width: 460px;
}

.learning-history-table th,
.learning-history-table td {
  border-bottom: 1px solid var(--border);
  padding: 9px 10px;
  text-align: left;
  font-size: 0.88rem;
}

.learning-history-table thead th {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.learning-history-table tbody th {
  font-weight: 750;
  white-space: nowrap;
}

.learning-history-table tr.is-quiet {
  color: var(--muted);
}

.learning-result-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)) !important;
}

/* Chips sit on a white card here, so the usual white pill would vanish. */
.learning-task-skills .learning-prerequisite-list > span {
  border: 1px solid var(--border);
  background: var(--surface-muted);
}

.learning-workflow-section {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.learning-area-section {
  scroll-margin-top: 18px;
}

.learning-area-tabs {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 18px 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  -webkit-overflow-scrolling: touch;
}

.learning-area-tab {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 9px 14px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  text-decoration: none;
}

.learning-area-tab:hover,
.learning-area-tab:focus-visible {
  background: var(--surface-muted);
  color: var(--text);
}

.learning-section-intro {
  margin: 0 0 12px;
}

.learning-section-intro .field-hint {
  max-width: 520px;
  text-align: right;
}

.learning-coach-card {
  border-left: 4px solid #3b82f6;
  margin-bottom: 20px;
}

.learning-progress-panel {
  scroll-margin-top: 72px;
}

.learning-progress-metrics {
  margin-bottom: 16px;
}

.learning-technique-feedback-list,
.learning-onboarding-steps {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding-left: 20px;
}

.learning-technique-feedback-list li {
  color: var(--muted);
  font-size: 0.88rem;
}

.learning-technique-feedback-list span:first-child {
  color: var(--text);
  font-weight: 800;
}

.learning-danger-zone {
  scroll-margin-top: 72px;
}

.learning-danger-row {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  border: 1px solid #f4b7ad;
  border-radius: 10px;
  padding: 14px;
  background: #fff7f5;
}

.learning-danger-row p {
  margin-bottom: 0;
}

.learning-workflow-section + .learning-workflow-section,
.learning-workflow-section + .learning-workflow-grid,
.learning-workflow-grid + .learning-workflow-grid,
.learning-workflow-grid + .learning-map-section,
.learning-map-section + .learning-workflow-section,
.learning-area-section + .learning-workflow-section {
  margin-top: 20px;
}

.learning-workflow-section h2 {
  margin: 0;
  font-size: 1.15rem;
}

.learning-workflow-section .section-heading {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 16px;
}

.learning-workflow-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

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

.learning-task-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px;
  background: var(--surface-muted);
}

.learning-task-card.learning-task-overdue {
  border-left: 4px solid var(--accent);
}

.learning-task-heading {
  align-items: flex-start;
  display: flex;
  gap: 14px;
  justify-content: space-between;
}

.learning-task-heading > div {
  min-width: 0;
}

.learning-task-heading h3 {
  margin: 0;
  font-size: 1.02rem;
}

.learning-task-heading p,
.learning-task-rationale {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.learning-task-due {
  border-radius: 999px;
  padding: 4px 10px;
  background: #ffffff;
  font-size: 0.78rem;
  font-weight: 750;
  white-space: nowrap;
}

.learning-task-due.is-overdue {
  background: #fbe5e2;
  color: var(--accent);
}

.learning-task-card .learning-prerequisite-list {
  margin-top: 12px;
}

.learning-task-hints {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--surface-muted);
}

.learning-task-hints summary {
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 800;
}

.learning-task-hints ol {
  margin: 10px 0 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 0.9rem;
}

.learning-task-hints li + li {
  margin-top: 6px;
}

.learning-task-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
}

.text-link-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 0;
  text-decoration: underline;
}

.text-link-button:hover {
  color: var(--accent);
}

.learning-task-actions form.button_to {
  display: inline-flex;
}

.learning-skill-picker {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 0;
  padding: 16px;
}

.learning-skill-picker legend {
  font-size: 0.82rem;
  font-weight: 750;
  padding: 0 6px;
}

.learning-skill-options {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-top: 10px;
}

.learning-skill-option {
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface-muted);
  font-size: 0.9rem;
}

.learning-skill-option > span:first-of-type {
  flex: 1;
  min-width: 0;
}

.learning-skill-primary {
  align-items: center;
  display: inline-flex;
  gap: 5px;
}

.learning-skill-primary-label {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.learning-technique-options {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.field-hint {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.learning-inline-note {
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  padding: 12px 14px;
  background: var(--surface-muted);
}

.learning-inline-note p {
  margin: 4px 0 0;
  font-size: 0.9rem;
}

.learning-task-skills strong,
.learning-inline-note strong {
  font-size: 0.82rem;
  font-weight: 750;
}

.learning-review-list,
.learning-gap-list,
.learning-history-list {
  display: grid;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.learning-review-list li,
.learning-gap-list li,
.learning-history-list li {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--surface-muted);
}

.learning-review-list li {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  font-weight: 700;
}

.learning-review-meta {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.learning-review-meta.is-down {
  color: var(--accent);
}

.learning-history-heading {
  align-items: baseline;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.learning-history-list p,
.learning-gap-list p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.learning-activity-tag {
  display: inline-block;
  margin-top: 8px;
  border-radius: 999px;
  padding: 3px 9px;
  background: #ffffff;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 750;
}

.learning-gap-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-bottom: 16px;
}

.learning-gap-form input,
.learning-gap-classify select {
  min-width: 0;
  width: 100%;
}

.learning-gap-meta {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.learning-gap-meta form.button_to {
  display: inline-flex;
}

.learning-gap-classify {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  flex: 1;
  min-width: 220px;
}

.learning-gap-node {
  border-radius: 999px;
  padding: 4px 10px;
  background: #ffffff;
  font-size: 0.8rem;
  font-weight: 700;
}

.compact-empty-state {
  box-shadow: none;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

@media (max-width: 900px) {
  .learning-form .form-grid,
  .learning-node-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 720px) {
  .learning-page,
  .learning-form-page {
    width: min(100% - 20px, 100%);
  }

  .learning-hero,
  .learning-card-heading,
  .learning-area-heading,
  .learning-node-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .learning-new-button,
  .learning-hero .button {
    width: 100%;
  }

  .learning-card-metrics,
  .learning-overview-grid,
  .learning-form .form-grid,
  .learning-node-form-grid,
  

.status-pending { background: #fff4e5; color: #8a5300; }
.status-accepted { background: #e6f4ea; color: #1e6b34; }
.status-rejected { background: #fbe5e2; color: #a03725; }

.learning-task-card .learning-context-block {
  margin: 12px 0 0;
  background: #ffffff;
}

.learning-context-block {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  background: var(--surface-muted);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.78rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.learning-tutor-panel {
  border-left: 4px solid #94a3b8 !important;
}

.learning-tutor-panel p {
  margin: 0 0 8px !important;
}

.learning-core-policy {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding-left: 20px;
}

.learning-core-policy li {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.learning-checkbox-field {
  align-items: center;
  display: flex;
  gap: 9px;
}

.learning-checkbox-field label {
  margin: 0;
}

.learning-control-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 12px;
}

.learning-control {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--surface-muted);
}

.learning-control label {
  display: block;
  font-size: 0.82rem;
  font-weight: 750;
  margin-bottom: 8px;
}

.learning-control input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.learning-control-scale {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
}

.learning-control-value {
  color: var(--text);
  font-weight: 800;
}

.learning-graph {
  height: 460px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
}

.learning-graph-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

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

.learning-legend-swatch {
  width: 12px;
  height: 12px;
  border: 1px solid #1f2933;
  border-radius: 3px;
}

.learning-legend-swatch.is-weak { background: #c0392b; }
.learning-legend-swatch.is-strong { background: #166534; }
.learning-legend-swatch.is-due { border: 3px double #b91c1c; background: #ffffff; }

.learning-node-card.is-focused {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px #fbe5e2;
}

.learning-node-card:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.learning-stat-band {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.learning-stat {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.learning-stat dt {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.learning-stat dd {
  margin: 6px 0 0;
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1.1;
}

.learning-stat p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.learning-stat-secondary {
  background: var(--surface-muted);
  box-shadow: none;
}

.learning-distribution {
  display: grid;
  gap: 9px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.learning-distribution li {
  align-items: center;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 34px;
  gap: 10px;
}

.learning-distribution-label {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 750;
}

.learning-distribution-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #dce1e7;
}

.learning-distribution-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.learning-distribution-count {
  font-size: 0.86rem;
  font-weight: 800;
  text-align: right;
}

.learning-trend {
  align-items: flex-end;
  display: flex;
  gap: 3px;
  height: 120px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.learning-trend-day {
  align-items: flex-end;
  display: flex;
  flex: 1;
  height: 100%;
  min-width: 0;
}

.learning-trend-bar {
  display: block;
  width: 100%;
  min-height: 2px;
  border-radius: 3px 3px 0 0;
  background: #4d7c0f;
}

.learning-trend-bar.is-down {
  background: var(--accent);
}

/* A day with nothing demonstrated should not read as a small gain. */
.learning-trend-bar.is-flat {
  background: #cbd5e1;
}

.learning-foundation-area {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.learning-history-table-wrap {
  overflow-x: auto;
}

.learning-history-table {
  border-collapse: collapse;
  width: 100%;
  min-width: 460px;
}

.learning-history-table th,
.learning-history-table td {
  border-bottom: 1px solid var(--border);
  padding: 9px 10px;
  text-align: left;
  font-size: 0.88rem;
}

.learning-history-table thead th {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.learning-history-table tbody th {
  font-weight: 750;
  white-space: nowrap;
}

.learning-history-table tr.is-quiet {
  color: var(--muted);
}

.learning-result-grid {
    grid-template-columns: 1fr !important;
  }

  .learning-node-list {
    grid-template-columns: 1fr;
  }

  .learning-workflow-grid,
  .learning-skill-options {
    grid-template-columns: 1fr !important;
  }

  /* Even columns: unlike the skill form, no single field here deserves the width. */


.status-pending { background: #fff4e5; color: #8a5300; }
.status-accepted { background: #e6f4ea; color: #1e6b34; }
.status-rejected { background: #fbe5e2; color: #a03725; }

.learning-task-card .learning-context-block {
  margin: 12px 0 0;
  background: #ffffff;
}

.learning-context-block {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  background: var(--surface-muted);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.78rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.learning-tutor-panel {
  border-left: 4px solid #94a3b8 !important;
}

.learning-tutor-panel p {
  margin: 0 0 8px !important;
}

.learning-core-policy {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding-left: 20px;
}

.learning-core-policy li {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.learning-checkbox-field {
  align-items: center;
  display: flex;
  gap: 9px;
}

.learning-checkbox-field label {
  margin: 0;
}

.learning-control-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 12px;
}

.learning-control {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--surface-muted);
}

.learning-control label {
  display: block;
  font-size: 0.82rem;
  font-weight: 750;
  margin-bottom: 8px;
}

.learning-control input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.learning-control-scale {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
}

.learning-control-value {
  color: var(--text);
  font-weight: 800;
}

.learning-graph {
  height: 460px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
}

.learning-graph-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

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

.learning-legend-swatch {
  width: 12px;
  height: 12px;
  border: 1px solid #1f2933;
  border-radius: 3px;
}

.learning-legend-swatch.is-weak { background: #c0392b; }
.learning-legend-swatch.is-strong { background: #166534; }
.learning-legend-swatch.is-due { border: 3px double #b91c1c; background: #ffffff; }

.learning-node-card.is-focused {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px #fbe5e2;
}

.learning-node-card:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.learning-stat-band {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.learning-stat {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.learning-stat dt {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.learning-stat dd {
  margin: 6px 0 0;
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1.1;
}

.learning-stat p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.learning-stat-secondary {
  background: var(--surface-muted);
  box-shadow: none;
}

.learning-distribution {
  display: grid;
  gap: 9px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.learning-distribution li {
  align-items: center;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 34px;
  gap: 10px;
}

.learning-distribution-label {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 750;
}

.learning-distribution-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #dce1e7;
}

.learning-distribution-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.learning-distribution-count {
  font-size: 0.86rem;
  font-weight: 800;
  text-align: right;
}

.learning-trend {
  align-items: flex-end;
  display: flex;
  gap: 3px;
  height: 120px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.learning-trend-day {
  align-items: flex-end;
  display: flex;
  flex: 1;
  height: 100%;
  min-width: 0;
}

.learning-trend-bar {
  display: block;
  width: 100%;
  min-height: 2px;
  border-radius: 3px 3px 0 0;
  background: #4d7c0f;
}

.learning-trend-bar.is-down {
  background: var(--accent);
}

/* A day with nothing demonstrated should not read as a small gain. */
.learning-trend-bar.is-flat {
  background: #cbd5e1;
}

.learning-foundation-area {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.learning-history-table-wrap {
  overflow-x: auto;
}

.learning-history-table {
  border-collapse: collapse;
  width: 100%;
  min-width: 460px;
}

.learning-history-table th,
.learning-history-table td {
  border-bottom: 1px solid var(--border);
  padding: 9px 10px;
  text-align: left;
  font-size: 0.88rem;
}

.learning-history-table thead th {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.learning-history-table tbody th {
  font-weight: 750;
  white-space: nowrap;
}

.learning-history-table tr.is-quiet {
  color: var(--muted);
}

.learning-result-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)) !important;
}

/* Chips sit on a white card here, so the usual white pill would vanish. */
.learning-task-skills .learning-prerequisite-list > span {
  border: 1px solid var(--border);
  background: var(--surface-muted);
}

.learning-workflow-section {
  padding: 20px;
}

@media (max-width: 720px) {
  .learning-workflow-section {
    padding: 20px;
  }

  .learning-workflow-section .section-heading,
  .learning-task-heading,
  .learning-section-intro,
  .learning-danger-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .learning-area-tabs {
    top: 0;
    margin-inline: -2px;
    border-radius: 14px;
  }

  .learning-section-intro .field-hint {
    text-align: left;
  }

  .learning-workflow-section .section-heading .learning-card-actions,
  .learning-workflow-section .section-heading .button,
  .learning-danger-row .button_to,
  .learning-danger-row .button {
    width: 100%;
  }

  .learning-gap-form,
  .learning-gap-classify {
    grid-template-columns: minmax(0, 1fr);
    min-width: 0;
    width: 100%;
  }

  .learning-gap-meta {
    align-items: stretch;
    flex-direction: column;
  }

  .learning-gap-meta form.button_to,
  .learning-gap-meta .button_to button,
  .learning-gap-meta .text-link-button,
  .learning-gap-classify .button,
  .learning-gap-form .button {
    min-height: 44px;
    width: 100%;
  }
}

  
.status-pending { background: #fff4e5; color: #8a5300; }
.status-accepted { background: #e6f4ea; color: #1e6b34; }
.status-rejected { background: #fbe5e2; color: #a03725; }

.learning-task-card .learning-context-block {
  margin: 12px 0 0;
  background: #ffffff;
}

.learning-context-block {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  background: var(--surface-muted);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.78rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.learning-tutor-panel {
  border-left: 4px solid #94a3b8 !important;
}

.learning-tutor-panel p {
  margin: 0 0 8px !important;
}

.learning-core-policy {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding-left: 20px;
}

.learning-core-policy li {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.learning-checkbox-field {
  align-items: center;
  display: flex;
  gap: 9px;
}

.learning-checkbox-field label {
  margin: 0;
}

.learning-control-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 12px;
}

.learning-control {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--surface-muted);
}

.learning-control label {
  display: block;
  font-size: 0.82rem;
  font-weight: 750;
  margin-bottom: 8px;
}

.learning-control input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.learning-control-scale {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
}

.learning-control-value {
  color: var(--text);
  font-weight: 800;
}

.learning-graph {
    height: 340px;
  }

  .learning-stat-band {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .learning-control-grid {
    grid-template-columns: 1fr;
  }

  .learning-distribution li {
    grid-template-columns: 80px minmax(0, 1fr) 28px;
  }



  .learning-area-overview,
  .learning-map-section,
  .learning-form,
  .learning-empty-state {
    padding: 20px;
  }
}
