:root {
  --bg: #f7f3f5;
  --panel: rgba(255, 250, 251, 0.92);
  --panel-strong: #fffdfd;
  --line: #d9cfd3;
  --ink: #4e3c45;
  --muted: #88707b;
  --pink-soft: #ffe8ef;
  --pink-mid: #ffd4e3;
  --pink: #ffb8cc;
  --pink-bold: #ff98b3;
  --pink-deep: #e36c96;
  --green: #6c8b4c;
  --shadow: 0 26px 70px rgba(93, 67, 77, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--ink);
  background: #fffafb;
  overflow: hidden;
}

body.modal-open {
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button {
  border: none;
  cursor: pointer;
}

.hidden {
  display: none;
}

.shell {
  min-height: 100vh;
  padding: 0;
}

.window-frame {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  border: none;
  border-radius: 0;
  background: #fffafb;
  box-shadow: none;
  overflow: hidden;
}

.topbar {
  height: 56px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: #fffafb;
  -webkit-app-region: drag;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 1.45rem;
  letter-spacing: 0.04em;
  font-family: "Segoe Print", "Brush Script MT", cursive;
}

.brand-paw {
  font-size: 0.88em;
  line-height: 1;
}

.window-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  -webkit-app-region: no-drag;
}

.settings-toggle {
  height: 34px;
  padding: 0 12px;
  border: 1px solid #7d6671;
  border-radius: 999px;
  background: #fff1f6;
  color: #5c4650;
  font-size: 0.8rem;
  font-weight: 700;
}

.window-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  flex: 0 0 auto;
  border-radius: 999px;
  border: 1px solid #7d6671;
  color: #5c4650;
  background: var(--pink-soft);
  font-size: 1rem;
  line-height: 1;
  transition:
    transform 140ms ease,
    background 140ms ease;
}

.window-control:hover {
  transform: translateY(-1px) scale(1.03);
}

.close-control {
  background: var(--pink-mid);
}

.content-grid {
  height: calc(100vh - 56px);
  padding: 10px 8px;
  display: grid;
  grid-template-columns: minmax(276px, 0.96fr) minmax(230px, 1.04fr);
  align-items: stretch;
  gap: 8px;
  overflow: hidden;
}

.timer-panel,
.tasks-panel {
  min-height: 0;
  min-width: 0;
}

.timer-panel {
  position: relative;
  border: none;
  border-radius: 0;
  padding: 6px 0 12px;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  overflow: visible;
}

.sparkle {
  position: absolute;
  color: var(--pink-bold);
  font-size: 1.1rem;
  opacity: 0.85;
}

.sparkle-a {
  top: 22px;
  left: 20px;
  transform: rotate(-14deg);
}

.sparkle-b {
  left: 42px;
  bottom: 52px;
  font-size: 0.9rem;
  color: #ffb6cb;
}

.sparkle-c {
  top: 28px;
  right: 24px;
  color: #ffc5d7;
}

.paw-wrap {
  position: relative;
  width: min(100%, 264px);
  aspect-ratio: 3 / 2;
  margin-top: -4px;
  margin-bottom: 6px;
}

.paw-art {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 48%;
  width: 101%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
  transform: translateX(-50%);
  filter: drop-shadow(0 14px 18px rgba(216, 163, 178, 0.28));
}

.paw-center {
  position: absolute;
  left: 48%;
  top: 57.1%;
  z-index: 2;
  width: 146px;
  min-height: 56px;
  padding: 2px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  text-align: center;
  transform: translate(-50%, -50%);
}

.timer-display {
  font-size: clamp(1rem, 3.6vw, 1.38rem);
  font-weight: 900;
  letter-spacing: 0.03em;
  line-height: 1;
  color: #a45d7c;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.86);
}

.primary-btn {
  margin-top: 10px;
  padding: 8px 16px;
  border: 2px solid #111;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffc0d2, #ffadc6);
  color: #111;
  font-weight: 800;
  box-shadow: 0 3px 0 #111;
  transition:
    transform 120ms ease,
    box-shadow 120ms ease;
  font-size: 0.82rem;
}

.primary-btn:active,
.secondary-btn:active,
.plus-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #111;
}

.secondary-controls,
.mode-switch {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.secondary-controls {
  margin-top: 2px;
}

.mode-switch {
  row-gap: 6px;
  margin-top: 8px;
}

.secondary-controls .primary-btn {
  margin-top: 0;
  padding: 5px 12px;
  border-radius: 11px;
  box-shadow: 0 2px 0 #111;
  font-size: 0.69rem;
}

.secondary-btn,
.mode-btn {
  border: 2px solid #111;
  border-radius: 11px;
  background: rgba(255, 241, 246, 0.9);
  color: var(--ink);
  padding: 5px 8px;
  box-shadow: 0 2px 0 #111;
  font-size: 0.68rem;
}

.mode-btn.active {
  background: linear-gradient(180deg, #ffd7e4, #ffb7cb);
  color: #111;
}

.status-text {
  margin: 12px 0 0;
  width: min(100%, 208px);
  min-height: 1.35em;
  text-align: center;
  color: var(--muted);
  font-size: 0.66rem;
  line-height: 1.35;
}

.ambience-summary {
  margin: 12px 0 2px;
  width: min(100%, 210px);
  padding: 5px 8px;
  border: 1px dashed #dcb9c7;
  border-radius: 999px;
  background: rgba(255, 242, 246, 0.78);
  color: #7d5a68;
  font-size: 0.63rem;
  text-align: center;
  line-height: 1.35;
}

.tasks-panel {
  padding: 4px 24px 0 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.tasks-panel::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.panel-heading {
  margin-bottom: 14px;
}

.headline-wrap {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.script-heading,
.sub-heading,
.panel-footer {
  font-family: "Segoe Print", "Brush Script MT", cursive;
}

.script-heading {
  font-size: 1.45rem;
  font-weight: 700;
}

.sub-heading {
  font-size: 1rem;
  opacity: 0.8;
}

.input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.plus-btn {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 2px solid #111;
  background: var(--pink-soft);
  color: var(--ink);
  font-size: 1.4rem;
  line-height: 1;
  box-shadow: 0 3px 0 #111;
}

.todo-input-wrap {
  flex: 1;
}

.todo-input {
  width: 100%;
  padding: 0 0 8px;
  border: none;
  border-bottom: 2px solid #4d3a43;
  background: transparent;
  color: var(--ink);
  font-size: 0.92rem;
  outline: none;
}

.todo-input::placeholder {
  color: #8c7a81;
}

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

.report-card {
  padding: 10px;
  border: 1px solid #eadde1;
  border-radius: 16px;
  background: rgba(255, 242, 246, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.report-label {
  font-size: 0.7rem;
  color: var(--muted);
}

.report-value {
  margin-top: 4px;
  font-size: 1.25rem;
  font-weight: 800;
}

.list-section {
  min-height: auto;
  display: block;
}

.list-section + .list-section {
  margin-top: 16px;
}

.section-title {
  margin-bottom: 10px;
  font-size: 0.95rem;
  font-weight: 800;
}

.task-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
  min-height: auto;
  overflow: visible;
  padding-right: 0;
}

.task-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid #eedee4;
  border-radius: 16px;
  background: rgba(255, 248, 250, 0.94);
}

.task-item.done {
  background: rgba(255, 238, 244, 0.95);
}

.task-toggle,
.task-remove {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d8b3c1;
  background: var(--pink-soft);
  color: var(--pink-deep);
  font-size: 0.8rem;
}

.done-toggle {
  background: var(--pink-mid);
  color: #b33b68;
}

.done-remove {
  color: #7d5b68;
}

.task-text {
  font-size: 0.86rem;
  line-height: 1.35;
}

.done .task-text {
  text-decoration: line-through;
  color: #725964;
}

.empty-state {
  padding: 10px 12px;
  border: 1px dashed #d8bcc6;
  border-radius: 14px;
  color: var(--muted);
  background: rgba(255, 250, 252, 0.72);
  font-size: 0.82rem;
}

.panel-footer {
  margin-top: 14px;
  padding-top: 0;
  color: #9a7f89;
  font-size: 0.9rem;
}

.settings-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  pointer-events: auto;
}

.settings-modal.hidden {
  display: none;
}

.settings-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(94, 67, 77, 0.26);
  backdrop-filter: blur(4px);
}

.settings-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  padding: 18px;
  border: 1px solid #e3cfd6;
  border-radius: 22px;
  background: #fffafb;
  box-shadow: 0 22px 48px rgba(102, 74, 84, 0.22);
  scrollbar-width: none;
  pointer-events: auto;
}

.settings-shell {
  position: relative;
  z-index: 1;
  width: min(420px, calc(100vw - 24px));
  pointer-events: auto;
}

.settings-card::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.settings-header {
  display: block;
  margin-bottom: 16px;
}

.settings-head-copy {
  min-width: 0;
}

.settings-title {
  margin: 0;
  font-size: 1.2rem;
}

.settings-copy {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.4;
}

.settings-form {
  display: grid;
  gap: 16px;
}

.settings-group {
  padding: 14px;
  border: 1px solid #ebdce1;
  border-radius: 18px;
  background: rgba(255, 246, 249, 0.78);
}

.settings-group-title {
  font-size: 0.92rem;
  font-weight: 800;
}

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

.duration-grid {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.settings-field {
  display: grid;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 700;
}

.settings-field-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.settings-field input[type="range"] {
  width: 100%;
  margin: 0;
  accent-color: #e36c96;
}

.settings-field input[type="range"]::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffd9e5, #ffb6cb);
}

.settings-field input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -5px;
  border: 2px solid #111;
  border-radius: 999px;
  background: #fffafb;
}

.settings-field input[type="range"]::-moz-range-track {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffd9e5, #ffb6cb);
}

.settings-field input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 2px solid #111;
  border-radius: 999px;
  background: #fffafb;
}

.sound-grid {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.sound-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #e2cad4;
  border-radius: 14px;
  background: #fffdfd;
  font-size: 0.82rem;
  font-weight: 700;
}

.sound-option input {
  width: 16px;
  height: 16px;
  accent-color: #e36c96;
}

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

.settings-primary {
  min-width: 88px;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.82rem;
  font-weight: 800;
}

.settings-primary {
  border: 2px solid #111;
  background: linear-gradient(180deg, #ffc0d2, #ffadc6);
  color: #111;
  box-shadow: 0 3px 0 #111;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 540px) {
  .content-grid {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }

  .tasks-panel {
    overflow-y: visible;
  }
}

@media (max-width: 520px) {
  .report-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .timer-display {
    letter-spacing: 0.08em;
  }
}

@media (min-width: 541px) and (max-width: 1199px) {
  body {
    overflow-y: auto;
  }

  .content-grid {
    min-height: calc(100vh - 56px);
    height: auto;
    align-items: start;
    align-content: start;
  }

  .timer-panel,
  .tasks-panel {
    align-self: start;
  }

  .timer-panel {
    justify-content: flex-start;
    padding-top: 18px;
  }

  .tasks-panel {
    justify-content: flex-start;
    padding-top: 18px;
    overflow-y: visible;
  }
}

@media (min-width: 1200px) {
  body {
    overflow-y: auto;
  }

  .shell {
    display: flex;
    justify-content: center;
    padding: 0 24px;
  }

  .window-frame {
    width: min(100%, 1320px);
  }

  .content-grid {
    min-height: calc(100vh - 56px);
    height: auto;
    flex: 1;
    padding: 18px 20px;
    grid-template-columns: minmax(300px, 0.95fr) minmax(360px, 1.05fr);
    align-items: start;
    align-content: start;
    gap: 24px;
  }

  .timer-panel,
  .tasks-panel {
    align-self: start;
  }

  .tasks-panel {
    justify-content: flex-start;
    padding-top: 0;
    padding-bottom: 0;
    overflow-y: visible;
  }
}

body.embedded-preview {
  overflow: hidden;
}

body.desktop-app .content-grid,
body.embedded-preview .content-grid {
  min-height: 0;
  height: calc(100vh - 56px);
  align-items: stretch;
  align-content: stretch;
}

body.desktop-app .timer-panel,
body.desktop-app .tasks-panel,
body.embedded-preview .timer-panel,
body.embedded-preview .tasks-panel {
  align-self: stretch;
}

body.desktop-app .timer-panel,
body.embedded-preview .timer-panel {
  justify-content: center;
  padding-top: 6px;
}

body.desktop-app .tasks-panel,
body.embedded-preview .tasks-panel {
  justify-content: flex-start;
  padding-top: 4px;
  padding-bottom: 0;
  overflow-y: auto;
}
