.time-saver-app {
  --time-saver-shell: #faf2e8;
  --time-saver-paper: #fff7e8;
  --time-saver-panel: #fffdf7;
  --time-saver-panel-alt: #faecd4;
  --time-saver-line: #6b5745;
  --time-saver-ink: #2b2119;
  --time-saver-muted: #766858;
  --time-saver-cta: #f2e3d3;
  --time-saver-cta-hover: #ead4bd;
  --time-saver-result: #e3efd2;
  --time-saver-result-line: #4f6b3c;
  --time-saver-danger: #f8ded4;
  --time-saver-shadow: 5px 5px 0 rgba(107, 87, 69, 0.18);
  box-sizing: border-box;
  width: min(calc(100% - 16px), 824px);
  margin: 14px auto 24px;
  overflow: hidden;
  border: 2px solid var(--time-saver-line);
  border-radius: 0;
  background:
    linear-gradient(rgba(107, 87, 69, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(107, 87, 69, 0.045) 1px, transparent 1px),
    var(--time-saver-shell);
  background-size: 22px 22px;
  color: var(--time-saver-ink);
  box-shadow: var(--time-saver-shadow);
  isolation: isolate;
}

.time-saver-app *,
.time-saver-app *::before,
.time-saver-app *::after {
  box-sizing: border-box;
}

.time-saver-title {
  display: grid;
  gap: 8px;
  padding: 13px 15px;
  background:
    linear-gradient(135deg, rgba(255, 253, 247, 0.96), rgba(250, 236, 212, 0.9)),
    var(--time-saver-paper);
}

.time-saver-title .time-saver-kicker {
  display: inline-block;
  width: fit-content;
  margin: 0;
  padding: 4px 8px;
  border: 1.5px solid var(--time-saver-line);
  background: #f4dfba;
  color: var(--time-saver-muted);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
}

.time-saver-title h2 {
  margin: 0;
  color: var(--time-saver-ink);
  font-size: 23px;
  font-weight: 950;
  line-height: 1.15;
  letter-spacing: 0;
}

.time-saver-title p {
  max-width: 590px;
  margin: 0;
  color: var(--time-saver-muted);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.45;
}

.time-saver-workbench {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 10px;
  padding: 10px 12px 12px;
  border-top: 2px solid var(--time-saver-line);
}

.time-saver-panel,
.time-saver-list-card {
  border: 2px solid var(--time-saver-line);
  border-radius: 0;
  background: var(--time-saver-panel);
  box-shadow: 3px 3px 0 rgba(107, 87, 69, 0.16);
}

.time-saver-panel {
  min-width: 0;
  padding: 10px;
}

.time-saver-panel--entry {
  display: grid;
  gap: 10px;
  align-content: start;
}

.time-saver-panel--result {
  display: grid;
  gap: 9px;
  align-content: start;
}

.time-saver-panel-head {
  display: grid;
  gap: 4px;
}

.time-saver-panel-head h3,
.time-saver-list-head h3 {
  margin: 0;
  color: var(--time-saver-ink);
  font-size: 15px;
  font-weight: 900;
  line-height: 1.3;
  letter-spacing: 0;
}

.time-saver-panel-head p,
.time-saver-list-head p {
  margin: 0;
  color: var(--time-saver-muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
}

.time-saver-form-grid {
  display: grid;
  grid-template-columns: 1fr 124px;
  gap: 9px;
  align-items: end;
}

.time-saver-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.time-saver-field:first-child {
  grid-column: 1 / -1;
}

.time-saver-app label {
  margin: 0;
  color: var(--time-saver-ink);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.35;
}

.time-saver-app input[type="text"],
.time-saver-app input[type="number"] {
  width: 100%;
  min-height: 40px;
  margin: 0;
  padding: 8px 10px;
  border: 2px solid var(--time-saver-line);
  border-radius: 0;
  background: #fffdf7;
  color: var(--time-saver-ink);
  font-size: 14px;
  font-weight: 750;
  line-height: 1.35;
  box-shadow: inset 2px 2px 0 rgba(107, 87, 69, 0.08);
}

.time-saver-app input::placeholder {
  color: #ad9e90;
  font-weight: 600;
}

.time-saver-app input:focus {
  outline: 3px solid rgba(210, 170, 85, 0.4);
  outline-offset: 2px;
}

.time-saver-button,
.time-saver-app button.time-saver-button,
.time-saver-app .habit-delete {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 38px !important;
  border: 2px solid var(--time-saver-line) !important;
  border-radius: 0 !important;
  padding: 8px 10px !important;
  color: var(--time-saver-ink) !important;
  font-size: 13px !important;
  font-weight: 850 !important;
  line-height: 1.2 !important;
  text-align: center !important;
  text-decoration: none !important;
  cursor: pointer !important;
  box-shadow: 2px 2px 0 rgba(107, 87, 69, 0.18) !important;
  transition: transform 120ms ease, background-color 120ms ease, box-shadow 120ms ease !important;
  white-space: normal !important;
}

.time-saver-button:hover,
.time-saver-app .habit-delete:hover {
  transform: translateY(-1px);
  box-shadow: 3px 3px 0 rgba(107, 87, 69, 0.2) !important;
}

.time-saver-button--primary,
.time-saver-app button.time-saver-button--primary {
  align-self: end;
  background: var(--time-saver-cta) !important;
}

.time-saver-button--primary:hover {
  background: var(--time-saver-cta-hover) !important;
}

.time-saver-button--secondary,
.time-saver-app button.time-saver-button--secondary {
  background: #fff7e8 !important;
}

.time-saver-list-card {
  display: grid;
  gap: 9px;
  padding: 10px;
}

.time-saver-list-head {
  display: grid;
  gap: 4px;
}

.habits-list {
  display: grid;
  gap: 7px;
  min-height: 104px;
  max-height: 194px;
  overflow-y: auto;
  padding-right: 2px;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 96px;
  border: 1px dashed rgba(107, 87, 69, 0.5);
  background: rgba(250, 236, 212, 0.42);
  text-align: center;
}

.empty-state p {
  margin: 0;
  color: var(--time-saver-muted);
  font-size: 14px;
  font-weight: 750;
  line-height: 1.45;
}

.habit-item {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  padding: 8px;
  border: 2px solid rgba(107, 87, 69, 0.62);
  background: #fff7e8;
}

.habit-marker {
  width: 10px;
  height: 10px;
  border: 2px solid var(--time-saver-line);
  background: #d2aa55;
}

.habit-details {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.habit-name {
  overflow-wrap: anywhere;
  color: var(--time-saver-ink);
  font-size: 14px;
  font-weight: 850;
  line-height: 1.35;
}

.habit-time {
  color: var(--time-saver-muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.time-saver-app .habit-delete {
  min-height: 34px !important;
  padding: 6px 8px !important;
  background: var(--time-saver-danger) !important;
  font-size: 12px !important;
  box-shadow: none !important;
}

.time-saver-action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-items: stretch;
}

.time-saver-result-hero {
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 2px solid var(--time-saver-result-line);
  background: var(--time-saver-result);
  text-align: center;
}

.time-saver-result-label,
.time-saver-result-note {
  color: #3f5832;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.4;
}

.time-saver-result-hero strong {
  color: #24371e;
  font-size: clamp(30px, 4.4vw, 40px);
  font-weight: 950;
  line-height: 1;
  letter-spacing: 0;
}

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

.stat-card {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px 8px;
  border: 2px solid rgba(107, 87, 69, 0.72);
  background: #fff7e8;
  text-align: center;
}

.stat-value {
  overflow-wrap: anywhere;
  color: var(--time-saver-ink);
  font-size: 20px;
  font-weight: 950;
  line-height: 1.15;
}

.stat-label,
.stat-unit {
  color: var(--time-saver-muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
}

.time-saver-visual-row {
  display: grid;
  grid-template-columns: minmax(118px, 0.72fr) minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
  overflow: hidden;
  border: 2px solid rgba(107, 87, 69, 0.72);
  background:
    linear-gradient(135deg, rgba(227, 239, 210, 0.66), rgba(255, 247, 232, 0.9)),
    var(--time-saver-paper);
}

.progress-container {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 122px;
  padding: 10px;
  border: 0;
  border-right: 2px solid rgba(107, 87, 69, 0.5);
  background: transparent;
}

.progress-ring {
  width: 112px;
  height: 112px;
  filter: drop-shadow(2px 2px 0 rgba(107, 87, 69, 0.12));
}

.progress-ring-circle-bg {
  fill: transparent;
  stroke: rgba(107, 87, 69, 0.2);
  stroke-width: 12;
}

.progress-ring-circle {
  fill: transparent;
  stroke: #5f7d46;
  stroke-width: 12;
  stroke-linecap: butt;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  transition: stroke-dashoffset 180ms ease;
}

.progress-text {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
}

.progress-percentage {
  color: var(--time-saver-ink);
  font-size: 20px;
  font-weight: 950;
  line-height: 1.15;
}

.progress-label {
  color: var(--time-saver-muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
}

.time-saver-breakdown {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  align-self: stretch;
  min-width: 0;
  background: rgba(255, 253, 247, 0.88);
}

.breakdown-item {
  display: grid;
  gap: 4px;
  min-height: 122px;
  align-content: center;
  min-width: 0;
  padding: 12px 8px;
  border: 0;
  border-right: 1px solid rgba(107, 87, 69, 0.34);
  background: transparent;
  text-align: center;
}

.breakdown-item:last-child {
  border-right: 0;
}

.breakdown-value {
  overflow-wrap: anywhere;
  color: var(--time-saver-ink);
  font-size: 26px;
  font-weight: 950;
  line-height: 1;
}

.breakdown-label {
  color: var(--time-saver-muted);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.3;
}

.toast-message {
  position: fixed;
  z-index: 10000;
  left: 50%;
  bottom: 24px;
  max-width: min(460px, calc(100vw - 32px));
  transform: translateX(-50%);
  padding: 10px 14px;
  border: 2px solid var(--time-saver-line, #6b5745);
  border-radius: 0;
  background: #2b2119;
  color: #fff7e8;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.4;
  box-shadow: 3px 3px 0 rgba(107, 87, 69, 0.22);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast-message--hide {
  opacity: 0;
  transform: translate(-50%, 12px);
}

body[data-scheme="dark"] .time-saver-app,
html[data-theme="dark"] .time-saver-app,
body.dark-mode .time-saver-app,
.time-saver-app.dark {
  --time-saver-shell: #211a15;
  --time-saver-paper: #2b2119;
  --time-saver-panel: #30251d;
  --time-saver-panel-alt: #3a2b20;
  --time-saver-line: #c8ac82;
  --time-saver-ink: #fff4df;
  --time-saver-muted: #dfccb2;
  --time-saver-cta: #ead4bd;
  --time-saver-cta-hover: #f2dfc8;
  --time-saver-result: #263722;
  --time-saver-result-line: #b9d59a;
  --time-saver-danger: #4b2a24;
  background:
    linear-gradient(rgba(250, 236, 212, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(250, 236, 212, 0.055) 1px, transparent 1px),
    var(--time-saver-shell);
}

body[data-scheme="dark"] .time-saver-title,
html[data-theme="dark"] .time-saver-title,
body.dark-mode .time-saver-title,
.time-saver-app.dark .time-saver-title {
  background:
    linear-gradient(135deg, rgba(48, 37, 29, 0.98), rgba(58, 43, 32, 0.92)),
    var(--time-saver-paper);
}

body[data-scheme="dark"] .time-saver-title .time-saver-kicker,
html[data-theme="dark"] .time-saver-title .time-saver-kicker,
body.dark-mode .time-saver-title .time-saver-kicker,
.time-saver-app.dark .time-saver-title .time-saver-kicker {
  background: #3a2b20;
  border-color: rgba(200, 172, 130, 0.72);
}

body[data-scheme="dark"] .time-saver-app input[type="text"],
body[data-scheme="dark"] .time-saver-app input[type="number"],
html[data-theme="dark"] .time-saver-app input[type="text"],
html[data-theme="dark"] .time-saver-app input[type="number"],
body.dark-mode .time-saver-app input[type="text"],
body.dark-mode .time-saver-app input[type="number"],
.time-saver-app.dark input[type="text"],
.time-saver-app.dark input[type="number"] {
  background: #261e18;
  color: var(--time-saver-ink);
}

body[data-scheme="dark"] .empty-state,
html[data-theme="dark"] .empty-state,
body.dark-mode .empty-state,
.time-saver-app.dark .empty-state,
body[data-scheme="dark"] .habit-item,
html[data-theme="dark"] .habit-item,
body.dark-mode .habit-item,
.time-saver-app.dark .habit-item,
body[data-scheme="dark"] .stat-card,
html[data-theme="dark"] .stat-card,
body.dark-mode .stat-card,
.time-saver-app.dark .stat-card {
  background: #2b2119;
}

body[data-scheme="dark"] .time-saver-visual-row,
html[data-theme="dark"] .time-saver-visual-row,
body.dark-mode .time-saver-visual-row,
.time-saver-app.dark .time-saver-visual-row {
  background:
    linear-gradient(135deg, rgba(38, 55, 34, 0.88), rgba(48, 37, 29, 0.94)),
    var(--time-saver-panel);
}

body[data-scheme="dark"] .time-saver-breakdown,
html[data-theme="dark"] .time-saver-breakdown,
body.dark-mode .time-saver-breakdown,
.time-saver-app.dark .time-saver-breakdown {
  background: rgba(43, 33, 25, 0.82);
}

body[data-scheme="dark"] .time-saver-result-label,
body[data-scheme="dark"] .time-saver-result-note,
body[data-scheme="dark"] .time-saver-result-hero strong,
html[data-theme="dark"] .time-saver-result-label,
html[data-theme="dark"] .time-saver-result-note,
html[data-theme="dark"] .time-saver-result-hero strong,
body.dark-mode .time-saver-result-label,
body.dark-mode .time-saver-result-note,
body.dark-mode .time-saver-result-hero strong,
.time-saver-app.dark .time-saver-result-label,
.time-saver-app.dark .time-saver-result-note,
.time-saver-app.dark .time-saver-result-hero strong {
  color: #eff5df;
}

body[data-scheme="dark"] .time-saver-app button.time-saver-button--primary,
html[data-theme="dark"] .time-saver-app button.time-saver-button--primary,
body.dark-mode .time-saver-app button.time-saver-button--primary,
.time-saver-app.dark button.time-saver-button--primary,
body[data-scheme="dark"] .time-saver-app button.time-saver-button--secondary,
html[data-theme="dark"] .time-saver-app button.time-saver-button--secondary,
body.dark-mode .time-saver-app button.time-saver-button--secondary,
.time-saver-app.dark button.time-saver-button--secondary {
  color: #2b2119 !important;
}

body[data-scheme="dark"] .time-saver-app button.time-saver-button--secondary,
html[data-theme="dark"] .time-saver-app button.time-saver-button--secondary,
body.dark-mode .time-saver-app button.time-saver-button--secondary,
.time-saver-app.dark button.time-saver-button--secondary {
  background: #f2e4cf !important;
}

body[data-scheme="dark"] .time-saver-app .habit-delete,
html[data-theme="dark"] .time-saver-app .habit-delete,
body.dark-mode .time-saver-app .habit-delete,
.time-saver-app.dark .habit-delete {
  color: #fff4df !important;
}

@media (prefers-color-scheme: dark) {
  body[data-scheme="auto"] .time-saver-app {
    --time-saver-shell: #211a15;
    --time-saver-paper: #2b2119;
    --time-saver-panel: #30251d;
    --time-saver-panel-alt: #3a2b20;
    --time-saver-line: #c8ac82;
    --time-saver-ink: #fff4df;
    --time-saver-muted: #dfccb2;
    --time-saver-cta: #ead4bd;
    --time-saver-cta-hover: #f2dfc8;
    --time-saver-result: #263722;
    --time-saver-result-line: #b9d59a;
    --time-saver-danger: #4b2a24;
  }

  body[data-scheme="auto"] .time-saver-title {
    background:
      linear-gradient(135deg, rgba(48, 37, 29, 0.98), rgba(58, 43, 32, 0.92)),
      var(--time-saver-paper);
  }

  body[data-scheme="auto"] .time-saver-app input[type="text"],
  body[data-scheme="auto"] .time-saver-app input[type="number"] {
    background: #261e18;
    color: var(--time-saver-ink);
  }

  body[data-scheme="auto"] .empty-state,
  body[data-scheme="auto"] .habit-item,
  body[data-scheme="auto"] .stat-card {
    background: #2b2119;
  }

  body[data-scheme="auto"] .time-saver-visual-row {
    background:
      linear-gradient(135deg, rgba(38, 55, 34, 0.88), rgba(48, 37, 29, 0.94)),
      var(--time-saver-panel);
  }

  body[data-scheme="auto"] .time-saver-breakdown {
    background: rgba(43, 33, 25, 0.82);
  }

  body[data-scheme="auto"] .time-saver-result-label,
  body[data-scheme="auto"] .time-saver-result-note,
  body[data-scheme="auto"] .time-saver-result-hero strong {
    color: #eff5df;
  }

  body[data-scheme="auto"] .time-saver-app button.time-saver-button--primary,
  body[data-scheme="auto"] .time-saver-app button.time-saver-button--secondary {
    color: #2b2119 !important;
  }

  body[data-scheme="auto"] .time-saver-app button.time-saver-button--secondary {
    background: #f2e4cf !important;
  }

  body[data-scheme="auto"] .time-saver-app .habit-delete {
    color: #fff4df !important;
  }
}

@media (max-width: 820px) {
  .time-saver-workbench {
    grid-template-columns: 1fr;
  }

  .time-saver-form-grid {
    grid-template-columns: minmax(0, 1fr) minmax(130px, 0.34fr);
  }

  .time-saver-visual-row {
    grid-template-columns: minmax(118px, 0.58fr) minmax(0, 1fr);
  }
}

@media (max-width: 560px) {
  .time-saver-app {
    width: min(calc(100% - 12px), 440px);
    margin: 14px auto;
  }

  .time-saver-title {
    padding: 11px 12px;
  }

  .time-saver-title h2 {
    font-size: 22px;
  }

  .time-saver-title p,
  .time-saver-panel-head p,
  .time-saver-list-head p {
    font-size: 12px;
  }

  .time-saver-workbench {
    gap: 12px;
    padding: 12px;
  }

  .time-saver-panel,
  .time-saver-list-card {
    padding: 9px;
  }

  .time-saver-form-grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .time-saver-button,
  .time-saver-app button.time-saver-button {
    min-height: 44px !important;
  }

  .time-saver-action-row {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .time-saver-visual-row {
    grid-template-columns: 1fr;
  }

  .progress-container {
    min-height: 120px;
    border-right: 0;
    border-bottom: 2px solid rgba(107, 87, 69, 0.5);
  }

  .progress-ring {
    width: 112px;
    height: 112px;
  }

  .time-saver-breakdown {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .breakdown-item {
    min-height: 82px;
    padding: 10px 6px;
  }

  .breakdown-value {
    font-size: 23px;
  }
}

@media (max-width: 370px) {
  .time-saver-action-row {
    grid-template-columns: 1fr;
  }
}
