:root {
  color-scheme: light;

  --bg: #eef1f6;
  --panel: #ffffff;
  --panel-soft: #f6f7fa;

  --text: #293246;
  --text-strong: #1f2737;

  --muted: #727d91;
  --muted-light: #9099aa;

  --line: rgba(42,52,72,.10);

  --accent: #7484e8;
  --accent-soft: #e9ecff;
  --accent-2: #9b8bea;

  --danger: #c86e7c;
  --danger-bg: #fff0f2;

  --shadow:
    0 10px 28px rgba(44,54,78,.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;

  background:
    linear-gradient(
      180deg,
      #f2f4f8 0%,
      var(--bg) 100%
    );

  color: var(--text);

  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

body {
  min-height: 100vh;
}

button {
  font: inherit;
}

.app {
  width: min(720px, 100%);
  margin: 0 auto;

  padding:
    max(20px, env(safe-area-inset-top))
    16px
    calc(105px + env(safe-area-inset-bottom));
}


/* HEADER */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 20px;
  margin-bottom: 24px;
}

.eyebrow {
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .18em;
}

h1 {
  margin: 4px 0 3px;

  color: var(--text-strong);

  font-size: 30px;
  line-height: 1.05;
}

.hello {
  color: var(--muted);
  font-size: 13px;
}

.icon-button {
  width: 46px;
  height: 46px;

  border: 1px solid var(--line);
  border-radius: 15px;

  background: rgba(255,255,255,.80);

  color: #536078;
  font-size: 25px;

  cursor: pointer;

  box-shadow:
    0 5px 16px rgba(44,54,78,.06);
}


/* HERO */

.hero {
  position: relative;
  overflow: hidden;

  display: flex;
  align-items: center;
  justify-content: space-between;

  min-height: 112px;
  padding: 22px;

  border:
    1px solid rgba(116,132,232,.14);

  border-radius: 24px;

  background:
    linear-gradient(
      135deg,
      #e5e9ff 0%,
      #eeebff 100%
    );

  box-shadow: var(--shadow);
}

.hero::after {
  content: "";

  position: absolute;

  width: 150px;
  height: 150px;

  right: -55px;
  top: -70px;

  border-radius: 50%;

  background:
    rgba(126,116,210,.10);
}

.hero-label {
  color: #353f68;
  font-size: 23px;
  font-weight: 800;
}

.hero-subtitle {
  max-width: 275px;

  margin-top: 6px;

  color: #65708d;

  font-size: 13px;
  line-height: 1.4;
}

.counter {
  position: relative;
  z-index: 1;

  min-width: 52px;
  height: 52px;
  padding: 0 12px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 17px;

  background:
    rgba(116,132,232,.15);

  color: #5665bd;

  font-size: 23px;
  font-weight: 800;
}


/* STATUS */

.status {
  margin: 21px 2px 12px;

  color: var(--muted);

  font-size: 13px;
}


/* CARDS */

.inbox {
  display: grid;
  gap: 12px;
}

.card {
  padding: 17px;

  border:
    1px solid var(--line);

  border-radius: 20px;

  background:
    rgba(255,255,255,.94);

  box-shadow: var(--shadow);
}

.card-title {
  color: var(--text-strong);

  font-size: 16px;
  font-weight: 700;
  line-height: 1.42;

  overflow-wrap: anywhere;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;

  gap: 7px;

  margin-top: 10px;
}

.pill {
  padding: 5px 8px;

  border-radius: 999px;

  background: #f0f2f7;

  color: #788296;

  font-size: 11px;
}

.details {
  display: none;

  padding-top: 12px;

  color: var(--muted);

  font-size: 12px;
  line-height: 1.6;

  overflow-wrap: anywhere;
}

.details.open {
  display: block;
}


/* ACTIONS */

.actions {
  display: grid;

  grid-template-columns:
    minmax(0,1fr)
    minmax(0,1fr)
    minmax(0,1fr);

  gap: 8px;

  margin-top: 15px;
}

.action {
  min-height: 42px;

  padding: 8px 9px;

  border: 0;
  border-radius: 13px;

  cursor: pointer;

  font-size: 12px;
  font-weight: 700;
}

.action.primary {
  background:
    linear-gradient(
      135deg,
      #8192ef,
      #9b8bea
    );

  color: #ffffff;

  box-shadow:
    0 7px 16px rgba(116,132,232,.18);
}

.action.secondary {
  background: #f0f2f7;
  color: #566176;
}

.action.danger {
  background: var(--danger-bg);
  color: var(--danger);
}


/* EMPTY */

.empty {
  margin-top: 16px;

  padding: 34px 22px;

  border:
    1px dashed rgba(42,52,72,.14);

  border-radius: 22px;

  background:
    rgba(255,255,255,.45);

  text-align: center;

  color: var(--muted);
}

.empty-icon {
  display: block;

  margin-bottom: 10px;

  font-size: 34px;
}


/* ERRORS */

.error {
  padding: 18px;

  border:
    1px solid rgba(200,110,124,.20);

  border-radius: 18px;

  background: #fff2f4;

  color: #a95866;

  line-height: 1.45;
}


/* BOTTOM NAV */

.bottom-nav {
  position: fixed;
  z-index: 10;

  left: 50%;
  bottom: 0;

  transform:
    translateX(-50%);

  width: min(720px, 100%);

  display: grid;

  grid-template-columns:
    repeat(4,1fr);

  padding:
    10px 8px
    calc(
      10px
      + env(safe-area-inset-bottom)
    );

  border-top:
    1px solid var(--line);

  background:
    rgba(249,250,252,.94);

  backdrop-filter:
    blur(18px);
}

.nav-item {
  display: grid;

  gap: 4px;

  justify-items: center;

  padding: 6px 3px;

  border: 0;

  background: transparent;

  color: #9ba4b4;
}

.nav-item span {
  font-size: 20px;
}

.nav-item small {
  font-size: 10px;
}

.nav-item.active {
  color: var(--accent);
}

.nav-item:disabled {
  opacity: .65;
}


/*
Keep buttons horizontal on normal phones.
Only very narrow screens stack them.
*/

@media (max-width: 330px) {

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

}
/* === TASK v0.4A EDITOR === */

/* === TASK v0.4A EDITOR === */

.header-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.add-button {
  background:
    linear-gradient(
      135deg,
      #8192ef,
      #9b8bea
    );

  color: white;

  border: 0;

  font-size: 30px;
  font-weight: 400;
  line-height: 1;
}

.editor-backdrop {
  position: fixed;
  z-index: 100;

  inset: 0;

  padding:
    max(16px, env(safe-area-inset-top))
    12px
    max(16px, env(safe-area-inset-bottom));

  display: flex;
  align-items: flex-end;
  justify-content: center;

  background:
    rgba(31,39,55,.32);

  backdrop-filter:
    blur(8px);
}

.editor-backdrop[hidden] {
  display: none;
}

.editor-sheet {
  width: min(680px, 100%);
  max-height: 94vh;

  overflow-y: auto;

  padding: 22px;

  border:
    1px solid rgba(42,52,72,.10);

  border-radius: 28px;

  background: #ffffff;

  color: #293246;

  box-shadow:
    0 28px 80px rgba(36,45,64,.22);
}

.editor-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;

  gap: 20px;

  margin-bottom: 21px;
}

.editor-eyebrow {
  margin-bottom: 4px;

  color: #8192ef;

  font-size: 10px;
  font-weight: 800;
  letter-spacing: .18em;
}

.editor-header h2 {
  margin: 0;

  color: #20283a;

  font-size: 25px;
  line-height: 1.15;
}

.editor-close {
  width: 40px;
  height: 40px;

  flex: 0 0 auto;

  border: 0;
  border-radius: 13px;

  background: #f0f2f7;
  color: #727d91;

  cursor: pointer;

  font-size: 27px;
  line-height: 1;
}

.field {
  display: grid;
  gap: 7px;

  margin-bottom: 16px;
}

.field-label {
  color: #677287;

  font-size: 12px;
  font-weight: 700;
}

.field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 12px;
}

.text-input,
.select-input,
.markdown-editor {
  width: 100%;

  border:
    1px solid rgba(42,52,72,.12);

  border-radius: 14px;

  outline: none;

  background: #f7f8fb;

  color: #252e40;

  font: inherit;

  transition:
    border-color .15s ease,
    box-shadow .15s ease,
    background .15s ease;
}

.text-input,
.select-input {
  min-height: 46px;

  padding: 0 13px;
}

.markdown-editor {
  min-height: 190px;

  padding: 13px;

  resize: vertical;

  font-family:
    ui-monospace,
    SFMono-Regular,
    Menlo,
    Monaco,
    Consolas,
    monospace;

  font-size: 13px;
  line-height: 1.55;
}

.title-input {
  min-height: 52px;

  background: #ffffff;

  font-size: 17px;
  font-weight: 700;
}

.text-input:focus,
.select-input:focus,
.markdown-editor:focus {
  border-color:
    rgba(116,132,232,.55);

  background: #ffffff;

  box-shadow:
    0 0 0 4px
    rgba(116,132,232,.10);
}

.form-grid {
  display: grid;

  grid-template-columns:
    repeat(2,minmax(0,1fr));

  gap: 0 12px;
}

.field-wide {
  grid-column: 1 / -1;
}

.markdown-tabs {
  display: flex;

  padding: 3px;

  border-radius: 10px;

  background: #f0f2f7;
}

.markdown-tab {
  padding: 6px 9px;

  border: 0;
  border-radius: 8px;

  background: transparent;

  color: #7b8598;

  cursor: pointer;

  font-size: 11px;
  font-weight: 700;
}

.markdown-tab.active {
  background: white;

  color: #6677d8;

  box-shadow:
    0 2px 8px rgba(44,54,78,.08);
}

.markdown-preview {
  min-height: 190px;

  padding: 14px;

  border:
    1px solid rgba(42,52,72,.10);

  border-radius: 14px;

  background: #fafbfc;

  color: #323b4d;

  font-size: 14px;
  line-height: 1.6;
}

.markdown-preview h1,
.markdown-preview h2,
.markdown-preview h3 {
  margin:
    14px 0 7px;

  color: #222b3d;
}

.markdown-preview h1 {
  font-size: 22px;
}

.markdown-preview h2 {
  font-size: 19px;
}

.markdown-preview h3 {
  font-size: 16px;
}

.markdown-preview p {
  margin: 7px 0;
}

.markdown-preview pre {
  overflow-x: auto;

  padding: 12px;

  border-radius: 11px;

  background: #eef1f6;
}

.markdown-preview code {
  padding: 2px 5px;

  border-radius: 6px;

  background: #eef1f6;

  font-family:
    ui-monospace,
    SFMono-Regular,
    Menlo,
    Monaco,
    Consolas,
    monospace;
}

.markdown-preview pre code {
  padding: 0;
  background: transparent;
}

.md-line {
  margin: 5px 0;
}

.md-check {
  display: flex;
  align-items: flex-start;

  gap: 7px;

  margin: 5px 0;
}

.md-check input {
  margin-top: 4px;
}

.md-spacer {
  height: 6px;
}

.editor-help {
  display: flex;
  flex-wrap: wrap;
  align-items: center;

  gap: 7px;

  margin-top: 2px;
  margin-bottom: 19px;

  color: #8791a3;

  font-size: 11px;
}

.editor-help code {
  padding: 4px 7px;

  border-radius: 7px;

  background: #f0f2f7;

  color: #68748a;
}

.editor-actions {
  position: sticky;

  bottom: -22px;

  display: grid;

  grid-template-columns:
    minmax(0,.7fr)
    minmax(0,1.3fr);

  gap: 10px;

  margin:
    0 -22px -22px;

  padding:
    15px 22px
    calc(
      17px
      + env(safe-area-inset-bottom)
    );

  border-top:
    1px solid rgba(42,52,72,.08);

  background:
    rgba(255,255,255,.96);

  backdrop-filter:
    blur(14px);
}

.editor-button {
  min-height: 48px;

  border: 0;
  border-radius: 14px;

  cursor: pointer;

  font-size: 14px;
  font-weight: 800;
}

.editor-button.primary {
  background:
    linear-gradient(
      135deg,
      #8192ef,
      #9b8bea
    );

  color: #ffffff;
}

.editor-button.secondary {
  background: #f0f2f7;
  color: #677287;
}

.toast {
  position: fixed;

  z-index: 200;

  left: 50%;
  bottom:
    calc(
      86px
      + env(safe-area-inset-bottom)
    );

  transform:
    translateX(-50%);

  max-width:
    calc(100% - 32px);

  padding: 11px 16px;

  border-radius: 999px;

  background: #293246;
  color: white;

  box-shadow:
    0 9px 30px rgba(31,39,55,.22);

  font-size: 12px;
  font-weight: 700;
}

body.editor-open {
  overflow: hidden;
}

@media (max-width: 520px) {

  .editor-sheet {
    padding: 18px;

    border-radius: 24px 24px 18px 18px;
  }

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

  .field-wide {
    grid-column: auto;
  }

  .editor-actions {
    bottom: -18px;

    margin:
      0 -18px -18px;

    padding-left: 18px;
    padding-right: 18px;
  }

}


/* === TASK v0.4B VIEWS === */

.bottom-nav {
  grid-template-columns:
    repeat(5, 1fr);
}

.nav-item {
  cursor: pointer;
}

.nav-item small {
  white-space: nowrap;
}

.nav-item.active {
  color: var(--accent);
}

.view-section {
  margin-top: 12px;
}

.view-section + .view-section {
  margin-top: 24px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 12px;

  margin:
    5px 3px
    11px;

  color: #667287;

  font-size: 13px;
  font-weight: 800;
}

.section-count {
  min-width: 27px;

  padding: 4px 8px;

  border-radius: 999px;

  background: #e9ecf3;

  color: #7c879a;

  text-align: center;

  font-size: 10px;
}

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

.task-card {
  padding: 16px;

  border:
    1px solid rgba(42,52,72,.09);

  border-radius: 19px;

  background:
    rgba(255,255,255,.95);

  box-shadow:
    0 8px 22px rgba(44,54,78,.07);
}

.task-card.overdue {
  border-left:
    4px solid #d88794;
}

.task-card.today {
  border-left:
    4px solid #8192ef;
}

.task-card.done {
  opacity: .78;
}

.task-card-title {
  color: #222b3d;

  font-size: 15px;
  font-weight: 750;
  line-height: 1.4;

  overflow-wrap: anywhere;
}

.task-card.done
.task-card-title {
  text-decoration: line-through;
}

.task-card-meta {
  display: flex;
  flex-wrap: wrap;

  gap: 6px;

  margin-top: 9px;
}

.task-meta-pill {
  padding: 5px 8px;

  border-radius: 999px;

  background: #f0f2f7;

  color: #7b8598;

  font-size: 10px;
}

.task-meta-pill.due {
  background: #edf0ff;
  color: #6776d6;
}

.task-meta-pill.overdue {
  background: #fff0f2;
  color: #bf6675;
}

.task-meta-pill.priority-high {
  background: #fff3e8;
  color: #b8753a;
}

.task-meta-pill.priority-urgent {
  background: #ffedef;
  color: #c45f70;
}

.task-card-actions {
  display: flex;
  justify-content: flex-end;

  margin-top: 11px;
}

.task-open-button {
  min-height: 36px;

  padding: 7px 14px;

  border: 0;
  border-radius: 11px;

  background: #f0f2f7;
  color: #586379;

  cursor: pointer;

  font-size: 11px;
  font-weight: 750;
}

.project-block {
  margin-bottom: 18px;

  padding: 15px;

  border:
    1px solid rgba(42,52,72,.08);

  border-radius: 20px;

  background:
    rgba(255,255,255,.50);
}

.project-header {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 12px;

  margin-bottom: 11px;
}

.project-name {
  color: #30394d;

  font-size: 15px;
  font-weight: 800;
}

.project-category {
  margin-top: 2px;

  color: #9099aa;

  font-size: 10px;
}

.project-count {
  min-width: 30px;

  padding: 5px 8px;

  border-radius: 999px;

  background: #e9ecff;
  color: #6877d4;

  text-align: center;

  font-size: 10px;
  font-weight: 800;
}

@media (max-width: 420px) {

  .nav-item small {
    font-size: 9px;
  }

  .bottom-nav {
    padding-left: 3px;
    padding-right: 3px;
  }

}


/* === TASK v0.4.3 COMPACT UX === */

/*
Less empty vertical space.
Text and tap targets remain comfortable.
*/

.status {
  margin:
    15px 2px
    7px;
}

.view-section {
  margin-top: 6px;
}

.view-section + .view-section {
  margin-top: 11px;
}

.section-title {
  margin:
    1px 3px
    7px;

  font-size: 12px;
}

.task-list {
  gap: 8px;
}

.task-card {
  padding: 13px 14px;

  border-radius: 17px;
}

.task-card-title {
  font-size: 15px;
  line-height: 1.34;
}

.task-card-meta {
  gap: 5px;
  margin-top: 7px;
}

.task-meta-pill {
  padding: 4px 7px;

  font-size: 10px;
}

.task-card-actions {
  display: flex;
  gap: 7px;

  margin-top: 9px;
}

.task-open-button,
.task-done-button {
  flex: 1;

  min-height: 38px;

  padding: 7px 12px;

  border: 0;
  border-radius: 11px;

  cursor: pointer;

  font-size: 11px;
  font-weight: 800;
}

.task-open-button {
  background: #f0f2f7;
  color: #586379;
}

.task-done-button {
  background: #edf7f0;
  color: #4d8862;
}

.project-block {
  margin-bottom: 10px;

  padding: 12px;

  border-radius: 17px;
}

.project-header {
  margin-bottom: 8px;
}

.project-name {
  font-size: 14px;
}

.project-count {
  padding: 4px 7px;
}


/*
Inbox cards also become slightly denser.
*/

.card {
  padding: 14px;

  border-radius: 17px;
}

.card-meta {
  margin-top: 7px;
}

.actions {
  margin-top: 10px;
}


/*
Keep hero as a visual landmark,
but reduce excess spacing below it.
*/

.hero {
  margin-bottom: 0;
}

