:root {
  color-scheme: dark;
  --bg: #101817;
  --surface: #17211f;
  --surface-2: #1f2b28;
  --surface-3: #273531;
  --line: #34443f;
  --line-soft: rgba(255, 255, 255, 0.08);
  --text: #f3f6ee;
  --muted: #9aa89d;
  --faint: #65746b;
  --green: #74d990;
  --green-2: #a5efb4;
  --blue: #82c7ff;
  --yellow: #f0c86f;
  --red: #ff8e7d;
  --pink: #eea2c6;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body[data-theme="ocean"] {
  --bg: #101a1f;
  --surface: #162329;
  --surface-2: #1d3038;
  --surface-3: #27424d;
  --line: #375661;
  --green: #63d6c8;
  --green-2: #9ceee6;
  --blue: #8fc7ff;
  --yellow: #f4d47d;
  --red: #ff9b8b;
  --muted: #9db1b5;
}

body[data-theme="sunrise"] {
  --bg: #191612;
  --surface: #231f19;
  --surface-2: #30291e;
  --surface-3: #443727;
  --line: #5a4a38;
  --green: #ffc66d;
  --green-2: #ffe0a3;
  --blue: #ff9d7d;
  --yellow: #f9dc7a;
  --red: #ff7d7d;
  --muted: #b5a58f;
}

body[data-theme="mono"] {
  --bg: #111213;
  --surface: #1a1c1d;
  --surface-2: #242728;
  --surface-3: #303436;
  --line: #4b5355;
  --green: #d8e0dc;
  --green-2: #ffffff;
  --blue: #aebbc0;
  --yellow: #d7d0bb;
  --red: #e5aaa2;
  --muted: #a3aaab;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(116, 217, 144, 0.12), transparent 36rem),
    linear-gradient(135deg, #101817 0%, #151a20 42%, #121916 100%);
  color: var(--text);
  font-family: var(--font);
}

body[data-theme="ocean"] {
  background:
    radial-gradient(circle at top left, rgba(99, 214, 200, 0.14), transparent 36rem),
    linear-gradient(135deg, #101a1f 0%, #121d26 46%, #0f181c 100%);
}

body[data-theme="sunrise"] {
  background:
    radial-gradient(circle at top left, rgba(255, 198, 109, 0.14), transparent 34rem),
    linear-gradient(135deg, #191612 0%, #201c18 45%, #171412 100%);
}

body[data-theme="mono"] {
  background:
    radial-gradient(circle at top left, rgba(216, 224, 220, 0.08), transparent 34rem),
    linear-gradient(135deg, #111213 0%, #17191a 45%, #101112 100%);
}

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

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

.app-shell {
  width: min(1040px, calc(100% - 40px));
  margin: 0 auto;
  padding: 16px 0 42px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 20px;
  margin-bottom: 14px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 0.74rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(2.2rem, 7vw, 4.8rem);
  line-height: 0.9;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1rem;
  letter-spacing: 0;
}

.topbar-actions,
.task-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(23, 33, 31, 0.86);
  color: var(--text);
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.icon-button:hover {
  border-color: var(--green);
  background: var(--surface-2);
  color: var(--green-2);
  transform: translateY(-1px);
}

.icon-button.danger:hover {
  border-color: rgba(255, 142, 125, 0.8);
  color: var(--red);
}

.icon-button.small {
  width: 36px;
  height: 36px;
}

.icon-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.dashboard {
  display: grid;
  grid-template-columns: minmax(280px, 1.4fr) repeat(3, minmax(112px, 1fr));
  gap: 10px;
}

.level-card,
.stat-card,
.composer,
.task-panel,
.timer-card,
.media-card,
.task-inspector {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(23, 33, 31, 0.82);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.collapsible-section,
.progress-entry {
  margin-bottom: 16px;
}

.collapsible-section,
.panel-collapse {
  min-width: 0;
}

.section-summary,
.panel-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.section-summary::-webkit-details-marker,
.panel-summary::-webkit-details-marker {
  display: none;
}

.section-summary {
  margin-bottom: 0;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: none;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 14px;
  background: rgba(23, 33, 31, 0.82);
  box-shadow: var(--shadow);
}

.xp-page {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
}

.settings-page {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
}

.page-head {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 14px;
  background: rgba(23, 33, 31, 0.82);
  box-shadow: var(--shadow);
}

.page-head h2 {
  font-size: 1.2rem;
}

.xp-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
}

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

.report-card {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 14px;
  background: rgba(23, 33, 31, 0.82);
  box-shadow: var(--shadow);
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 10px;
}

.settings-card {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 16px;
  background: rgba(23, 33, 31, 0.82);
  box-shadow: var(--shadow);
}

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

.theme-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #0f1715;
  color: var(--text);
  font-weight: 850;
}

.theme-option:hover,
.theme-option.active {
  border-color: rgba(116, 217, 144, 0.56);
  background: rgba(116, 217, 144, 0.12);
}

.theme-swatch {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line-soft);
  border-radius: 50%;
}

.theme-swatch.forest {
  background: linear-gradient(135deg, #74d990, #82c7ff);
}

.theme-swatch.ocean {
  background: linear-gradient(135deg, #63d6c8, #8fc7ff);
}

.theme-swatch.sunrise {
  background: linear-gradient(135deg, #ffc66d, #ff9d7d);
}

.theme-swatch.mono {
  background: linear-gradient(135deg, #d8e0dc, #4b5355);
}

.report-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.report-head h3 {
  margin: 0;
  font-size: 0.95rem;
}

.report-head span {
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 850;
}

.bar-chart {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(34px, 1fr);
  align-items: end;
  gap: 8px;
  min-height: 150px;
}

.bar-item {
  display: grid;
  grid-template-rows: 1fr auto auto;
  gap: 6px;
  min-width: 0;
  height: 150px;
}

.bar-track {
  display: flex;
  align-items: end;
  overflow: hidden;
  border-radius: 8px;
  background: #0f1715;
}

.bar-fill {
  width: 100%;
  min-height: 4px;
  border-radius: inherit;
  background: linear-gradient(180deg, var(--green), var(--blue));
}

.bar-value,
.bar-label {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 750;
  line-height: 1.2;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-progress-track {
  display: block;
  flex: 1;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-3);
}

.summary-progress-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--blue));
}

.section-summary svg,
.panel-summary svg,
.collapse-button svg {
  transition: transform 160ms ease;
}

.collapsible-section:not([open]) .section-summary svg,
.panel-collapse:not([open]) > .panel-summary svg,
.task-card.collapsed .collapse-button svg {
  transform: rotate(-90deg);
}

.level-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
}

.level-ring {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 74px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(var(--green) var(--progress, 0%), var(--surface-3) 0);
  color: var(--text);
  font-size: 1.55rem;
  font-weight: 850;
  position: relative;
}

.level-ring::before {
  position: absolute;
  inset: 9px;
  border-radius: inherit;
  background: var(--surface);
  content: "";
}

.level-ring span {
  position: relative;
}

.level-copy {
  min-width: 0;
}

.level-copy h2 {
  margin-bottom: 6px;
  font-size: 1.08rem;
}

.level-copy p {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.8rem;
}

.progress-track {
  width: min(320px, 100%);
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-3);
}

.progress-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--blue));
  transition: width 220ms ease;
}

.stat-card {
  display: grid;
  align-content: center;
  min-height: 104px;
  padding: 14px;
}

.stat-card span {
  display: block;
  margin-bottom: 6px;
  font-size: clamp(1.45rem, 3vw, 2.1rem);
  font-weight: 850;
  letter-spacing: 0;
}

.stat-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.workspace {
  display: block;
}

.composer,
.task-panel,
.timer-card,
.media-card,
.task-inspector {
  padding: 16px;
}

.composer {
  position: sticky;
  top: 16px;
}

.focus-section,
.media-section,
.workspace {
  margin-bottom: 16px;
}

.timer-card {
  display: block;
  transition: transform 180ms ease, width 180ms ease;
  text-align: center;
}

.timer-summary {
  display: grid;
  grid-template-columns: 1fr auto 18px;
  gap: 12px;
  align-items: center;
  list-style: none;
  cursor: pointer;
  user-select: none;
  color: var(--text);
  font-weight: 850;
}

.timer-summary::-webkit-details-marker {
  display: none;
}

.timer-summary svg {
  color: var(--muted);
  transition: transform 160ms ease;
}

.timer-card:not([open]) .timer-summary svg {
  transform: rotate(-90deg);
}

#timerMiniDisplay {
  color: var(--text);
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: 0;
}

.timer-card[open] #timerMiniDisplay {
  display: none;
}

body.timer-floating .timer-summary {
  grid-template-columns: 1fr 18px;
}

body.timer-floating .timer-summary-label {
  display: none;
}

body.timer-floating #timerMiniDisplay {
  display: block;
  text-align: center;
}

.timer-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  justify-items: center;
  align-items: center;
  margin-top: 14px;
}

.timer-card select {
  min-height: 38px;
  max-width: 260px;
}

.timer-display,
.timer-time-input {
  display: block;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
  font-size: clamp(2.4rem, 7vw, 4.4rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  text-align: center;
}

.timer-time-input {
  width: min(420px, 100%);
  min-height: auto;
  border-radius: 8px;
}

.timer-display:hover {
  color: var(--green-2);
}

.timer-display:focus-visible,
.timer-time-input:focus-visible {
  outline-offset: 6px;
}

.timer-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
}

body.timer-floating .timer-card {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 25;
  width: min(300px, calc(100% - 28px));
  padding: 10px 12px;
}

body.timer-floating .timer-body {
  display: none;
}

body.timer-floating .timer-display {
  font-size: 2.4rem;
  text-align: center;
}

body.timer-floating .timer-actions {
  justify-content: center;
}

body.timer-maximized {
  overflow: hidden;
}

body.timer-maximized .timer-card {
  position: fixed;
  inset: 18px;
  z-index: 50;
  display: grid;
  align-content: center;
  width: auto;
  padding: clamp(18px, 4vw, 48px);
  background: rgba(15, 23, 21, 0.96);
}

body.timer-maximized .timer-summary {
  position: absolute;
  top: 18px;
  right: 18px;
  left: 18px;
}

body.timer-maximized .timer-body {
  display: grid;
  gap: 20px;
}

body.timer-maximized .timer-display {
  font-size: clamp(4.2rem, 16vw, 11rem);
}

body.timer-maximized .timer-time-input {
  font-size: clamp(4.2rem, 16vw, 11rem);
  width: min(820px, 100%);
}

body.timer-maximized .timer-card select {
  width: min(360px, 100%);
  max-width: 360px;
}

body.timer-maximized .compact-button,
body.timer-maximized .icon-button {
  min-height: 48px;
}

body.timer-maximized::before {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgba(0, 0, 0, 0.58);
  content: "";
}

.compact-button {
  min-height: 42px;
  padding: 0 16px;
}

.media-card {
  display: grid;
  gap: 12px;
}

.media-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 8px;
}

.media-card iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f1715;
}

form {
  display: grid;
  gap: 13px;
}

.panel-summary {
  min-height: 36px;
  margin-bottom: 14px;
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 850;
}

.panel-summary span + span {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.8rem;
}

.static-summary {
  cursor: default;
  margin-bottom: 8px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f1715;
  color: var(--text);
}

input,
select {
  min-height: 42px;
  padding: 0 12px;
}

textarea {
  resize: vertical;
  min-height: 90px;
  padding: 11px 12px;
}

::placeholder {
  color: var(--faint);
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  background: var(--green);
  color: #0b130f;
  font-weight: 850;
  transition: background 160ms ease, transform 160ms ease;
}

.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: rgba(15, 23, 21, 0.72);
  color: var(--text);
  font-weight: 850;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.secondary-button:hover {
  border-color: rgba(116, 217, 144, 0.56);
  background: var(--surface-2);
  color: var(--green-2);
}

.primary-button:hover {
  background: var(--green-2);
  transform: translateY(-1px);
}

.xp-preview {
  border: 1px solid rgba(130, 199, 255, 0.36);
  border-radius: 8px;
  padding: 11px 12px;
  background: rgba(130, 199, 255, 0.08);
  color: var(--blue);
  font-size: 0.86rem;
  font-weight: 850;
}

.achievements {
  margin-top: 14px;
  border-top: 1px solid var(--line-soft);
  padding-top: 12px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.panel-head span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

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

.achievement {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(15, 23, 21, 0.62);
  color: var(--faint);
}

.achievement.unlocked {
  border-color: rgba(116, 217, 144, 0.45);
  color: var(--text);
}

.achievement-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--surface-3);
  color: var(--yellow);
  font-weight: 850;
}

.achievement h3 {
  margin: 0 0 3px;
  font-size: 0.82rem;
}

.achievement p {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.4;
}

.controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 10px;
  margin-bottom: 12px;
}

.search-box {
  position: relative;
  display: block;
}

.search-box svg {
  position: absolute;
  top: 50%;
  left: 12px;
  width: 17px;
  height: 17px;
  color: var(--muted);
  transform: translateY(-50%);
}

.search-box input {
  padding-left: 38px;
}

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

.filter-chip {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  background: transparent;
  color: var(--muted);
  font-weight: 750;
}

.filter-chip.active,
.filter-chip:hover {
  border-color: rgba(116, 217, 144, 0.56);
  background: rgba(116, 217, 144, 0.12);
  color: var(--green-2);
}

.task-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.8rem;
}

.create-drawer {
  margin-top: 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 0;
}

.create-drawer[open] {
  border-style: solid;
  background: rgba(15, 23, 21, 0.48);
}

.add-task-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  width: 100%;
  padding: 12px;
  list-style: none;
  cursor: pointer;
  color: var(--green-2);
  font-weight: 850;
}

.add-task-summary::-webkit-details-marker {
  display: none;
}

.plus-disc {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--green);
  color: #0b130f;
}

.create-drawer form {
  border-top: 1px solid var(--line-soft);
  padding: 12px;
}

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

.task-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(15, 23, 21, 0.72);
  transition: border-color 160ms ease, background 160ms ease;
}

.task-card:hover,
.task-card.selected {
  border-color: rgba(116, 217, 144, 0.55);
  background: rgba(22, 35, 31, 0.86);
}

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

.task-card.overdue {
  border-color: rgba(255, 142, 125, 0.52);
}

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

.complete-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: transparent;
}

.complete-button:hover,
.task-card.done .complete-button {
  border-color: var(--green);
  background: rgba(116, 217, 144, 0.12);
  color: var(--green-2);
}

.task-content {
  min-width: 0;
}

.task-title-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.collapse-button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
}

.collapse-button:hover {
  border-color: rgba(116, 217, 144, 0.52);
  color: var(--green-2);
}

.task-title-input,
.task-notes-input {
  border: 0;
  min-height: auto;
  padding: 0;
  background: transparent;
}

.task-title-input {
  height: 30px;
  color: var(--text);
  font-size: 1rem;
  font-weight: 850;
}

.task-card.done .task-title-input {
  color: var(--muted);
  text-decoration: line-through;
}

.task-notes-input {
  min-height: 38px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.xp-pill,
.meta-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 9px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}

.xp-pill {
  border-color: rgba(130, 199, 255, 0.42);
  background: rgba(130, 199, 255, 0.1);
  color: var(--blue);
}

.task-details {
  overflow: hidden;
}

.task-card.collapsed .task-details {
  display: none;
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}

.meta-pill.priority-low {
  color: var(--muted);
}

.meta-pill.priority-medium {
  color: var(--blue);
}

.meta-pill.priority-high {
  color: var(--yellow);
}

.meta-pill.priority-urgent {
  color: var(--red);
}

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

.subtask-item {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 28px;
  gap: 7px;
  align-items: center;
  color: var(--muted);
  font-size: 0.8rem;
}

.subtask-item input {
  width: 17px;
  height: 17px;
  min-height: auto;
  accent-color: var(--green);
}

.subtask-item.done span {
  text-decoration: line-through;
}

.subtask-delete {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--faint);
}

.subtask-delete:hover {
  background: rgba(255, 142, 125, 0.1);
  color: var(--red);
}

.subtask-delete svg {
  width: 15px;
  height: 15px;
}

.inline-subtask-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  gap: 8px;
  margin-top: 10px;
}

.inline-subtask-form input {
  min-height: 36px;
}

.task-inspector {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 30;
  width: min(460px, calc(100% - 24px));
  height: 100vh;
  overflow: auto;
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  border-radius: 0;
  padding: 20px;
  transform: translateX(110%);
  transition: transform 180ms ease;
}

body.inspector-open .task-inspector {
  transform: translateX(0);
}

.inspector-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  border: 0;
  background: rgba(0, 0, 0, 0.42);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

body.inspector-open .inspector-backdrop {
  opacity: 1;
  pointer-events: auto;
}

body:not(.task-page-open) .task-inspector {
  display: none;
}

body.task-page-open .collapsible-section,
body.task-page-open .progress-entry,
body.task-page-open .xp-page,
body.task-page-open .settings-page,
body.task-page-open .focus-section,
body.task-page-open .media-section,
body.task-page-open .composer,
body.task-page-open .task-panel,
body.task-page-open .inspector-backdrop {
  display: none;
}

body.xp-page-open .progress-entry,
body.xp-page-open .focus-section,
body.xp-page-open .media-section,
body.xp-page-open .workspace {
  display: none;
}

body.settings-page-open .progress-entry,
body.settings-page-open .focus-section,
body.settings-page-open .media-section,
body.settings-page-open .workspace {
  display: none;
}

body.task-page-open .workspace {
  display: block;
}

body.task-page-open .task-inspector {
  position: static;
  display: block;
  width: min(860px, 100%);
  height: auto;
  margin: 0 auto;
  overflow: visible;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 18px;
  transform: none;
}

.inspector-empty {
  display: none;
}

.inspector-empty {
  color: var(--muted);
  text-align: center;
}

.inspector-empty h2 {
  margin-bottom: 8px;
  color: var(--text);
}

.inspector-empty p {
  margin-bottom: 0;
  font-size: 0.86rem;
  line-height: 1.5;
}

.hidden {
  display: none !important;
}

.inspector-form {
  gap: 12px;
}

.inspector-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.inspector-head h2 {
  max-width: 520px;
  overflow-wrap: anywhere;
}

.inspector-head > div {
  flex: 1;
  min-width: 0;
}

.task-read-view {
  display: grid;
  gap: 12px;
}

.read-hero {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(15, 23, 21, 0.62);
}

.read-hero h3 {
  margin: 0 0 8px;
  font-size: 1.25rem;
}

.read-hero p,
.read-pane p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.read-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  gap: 8px;
}

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

.read-subtasks {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(15, 23, 21, 0.62);
}

.read-subtasks h3 {
  margin: 0 0 10px;
  font-size: 0.95rem;
}

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

.read-subtask-item {
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #0f1715;
  color: var(--text);
  font-size: 0.86rem;
}

.read-subtask-item input {
  width: 17px;
  height: 17px;
  min-height: auto;
  accent-color: var(--green);
}

.read-subtask-item:has(input:checked) span {
  color: var(--muted);
  text-decoration: line-through;
}

.subtask-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.read-meta-card,
.read-pane {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(15, 23, 21, 0.62);
}

.read-meta-card span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.read-meta-card strong {
  display: block;
  overflow-wrap: anywhere;
}

.read-pane h3 {
  margin: 0 0 8px;
  font-size: 0.95rem;
}

.inspector-form.read-mode > label,
.inspector-form.read-mode > .field-grid,
.inspector-form.read-mode > .pane-editor {
  display: none;
}

.inspector-form.edit-mode .task-read-view {
  display: none;
}

.pane-editor {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line-soft);
  padding-top: 12px;
}

.pane-list {
  display: grid;
  gap: 9px;
}

.pane-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(15, 23, 21, 0.64);
}

.pane-card label {
  margin-bottom: 8px;
}

.pane-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  gap: 8px;
  align-items: center;
}

.pane-card textarea {
  min-height: 118px;
  font-size: 0.84rem;
  line-height: 1.5;
}

.add-pane-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  gap: 8px;
}

.add-pane-row input {
  min-height: 36px;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 32px 16px;
  color: var(--muted);
  text-align: center;
}

.empty-state h2 {
  margin-bottom: 8px;
  color: var(--text);
}

.compact-empty {
  padding: 18px 12px;
}

.compact-empty h2 {
  font-size: 0.92rem;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 10;
  max-width: min(360px, calc(100% - 40px));
  border: 1px solid rgba(116, 217, 144, 0.46);
  border-radius: 8px;
  padding: 12px 14px;
  background: #111b18;
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 0.88rem;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 900px) {
  .dashboard,
  .workspace,
  .xp-stat-grid,
  .xp-report-grid,
  .settings-grid,
  .read-meta-grid {
    grid-template-columns: 1fr;
  }

  .timer-body {
    grid-template-columns: 1fr;
  }

  .composer {
    position: static;
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: min(100% - 24px, 1180px);
    padding-top: 22px;
  }

  .topbar,
  .level-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard {
    gap: 10px;
  }

  .stat-card {
    min-height: 96px;
  }

  .controls,
  .field-grid,
  .task-card,
  .task-title-row {
    grid-template-columns: 1fr;
  }

  .timer-actions {
    justify-content: flex-start;
  }

  .task-actions {
    justify-content: flex-end;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
