/* Red, ink and paper theme. Keep task text and clock digits level. */
:root {
  --red: #c80829;
  --ink: #171519;
  --paper: #fffaf1;
}
body {
  color: var(--ink);
  background-color: #eee9e0;
  background-image: radial-gradient(#29232924 0.8px, transparent 0.9px);
  background-size: 6px 6px;
}
header {
  background: var(--ink);
  color: white;
  border-bottom: 5px solid var(--red);
}
.brand,
h1,
h2,
h3,
.clock {
  font-family: "Microsoft YaHei", system-ui, sans-serif;
  font-weight: 900;
}
.brand {
  font-style: italic;
}
.logo {
  color: #ff3754;
}
nav a {
  font-weight: 750;
}
nav a:hover {
  color: #ffb6bf;
}
main > h1 {
  width: fit-content;
  background: var(--ink);
  color: white;
  padding: 4px 28px 7px 12px;
  border-left: 8px solid var(--red);
  clip-path: polygon(0 0, 100% 0, calc(100% - 14px) 100%, 0 100%);
}
.hero {
  position: relative;
  isolation: isolate;
  color: white;
  background: var(--red);
  border: 3px solid var(--ink);
  border-radius: 0;
  box-shadow: 6px 6px var(--ink);
}
.hero:before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    repeating-linear-gradient(134deg, transparent 0 17px, #ffffff20 17px 20px),
    var(--ink);
  clip-path: polygon(75% 0, 100% 0, 100% 100%, 48% 100%);
}
.hero h1 {
  font-style: italic;
  text-shadow: 3px 3px var(--ink);
}
.hero p {
  color: white;
}
.dial {
  background:
    repeating-conic-gradient(var(--ink) 0 1deg, transparent 1deg 30deg),
    var(--paper);
  border-color: var(--ink);
  outline-color: white;
  box-shadow: 6px 9px var(--red);
}
.dial b {
  background: var(--paper);
  color: var(--ink);
  font-weight: 900;
}
.card,
form,
article,
.panel {
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 0;
  box-shadow: 3px 3px var(--ink);
}
.card {
  border-left: 6px solid var(--red);
}
.card:hover {
  border-color: var(--ink);
  background: white;
  box-shadow: 3px 3px var(--red);
}
.glyph {
  color: white;
  background: var(--ink);
  border-radius: 0;
  clip-path: polygon(9% 0, 100% 0, 91% 100%, 0 100%);
}
.desc,
.back,
.card small,
article small,
footer {
  color: #463f41;
}
.primary,
button,
.tabs button[aria-pressed="true"] {
  background: var(--ink);
  color: white;
  border-radius: 0;
  font-weight: 720;
}
.hero .primary {
  background: var(--paper);
  color: var(--ink);
  box-shadow: 3px 3px var(--ink);
}
.tabs button,
.todo-checklist button {
  background: #eee6dd;
  color: var(--ink);
  border: 1px solid var(--ink);
}
.pom-tool {
  --action: var(--red);
  --ground: var(--paper);
}
.pom-tool .focus-action {
  background: var(--red);
  box-shadow: 3px 3px var(--ink);
}
.pom-tool .timer-controls button:not(.focus-action) {
  border: 2px solid var(--ink);
  color: var(--ink);
}
.pom-face {
  box-shadow:
    0 0 0 3px var(--ink),
    5px 6px var(--ink);
}
.pom-face:before {
  background:
    repeating-conic-gradient(var(--ink) 0deg 1deg, transparent 1deg 6deg),
    var(--paper);
}
.pom-core {
  background: var(--ink);
  color: white;
}
.timer-tool .pom-core .clock {
  color: white;
  font-weight: 850;
}
.pom-sheet,
.sheet-meta div,
.sheet-urgent,
input,
textarea,
select {
  border-radius: 0;
  border-color: #665d61;
}
.sheet-main h2,
.sheet-memo h3 {
  border-bottom: 3px solid var(--ink);
}
.sheet-urgent,
.sheet-memo {
  background: #f8e3df;
  border-color: #71545c;
}
.sheet-total p,
.status {
  color: #91132c;
}
.pom-sheet li small {
  color: #53494b;
}
.pom-tool .timer-todo label:is(:hover, :focus-within) {
  background: #f7d8d8;
}
:focus-visible,
.pom-tool :is(button, input, select, textarea, summary):focus-visible {
  outline: 3px solid #ab0026;
  outline-offset: 3px;
}
header a:focus-visible,
.hero a:focus-visible {
  outline-color: white;
}
@media (max-width: 590px) {
  .hero {
    gap: 8px;
  }
  .hero h1 {
    font-size: clamp(22px, 6.8vw, 32px);
  }
  .dial {
    margin-right: 4px;
  }
}

.pom-sheet {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  border: 2px solid var(--ink);
  background: var(--paper);
}
.sheet-main,
.sheet-memo {
  padding: clamp(9px, 2vw, 22px);
}
.sheet-main h2,
.sheet-memo h3 {
  margin: 0 0 14px;
  padding: 8px 0;
  border-bottom: 3px solid var(--red);
  font-size: clamp(16px, 2.3vw, 24px);
}
.sheet-memo {
  background: #f6dfe0;
  border: 0;
  border-left: 2px solid var(--ink);
}
.sheet-meta {
  text-align: center;
}
.sheet-meta div {
  padding: 8px;
  border: 1px dashed var(--ink);
  font-weight: bold;
}
.sheet-main h3,
.sheet-total {
  text-align: center;
}
.sheet-urgent {
  border: 1px dashed var(--red);
  padding: 10px;
}
.pom-sheet summary {
  font-weight: 700;
  color: #841029;
  overflow-wrap: anywhere;
}
.pom-sheet .todo-heading {
  margin-top: 0;
}
.sheet-equation {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 3px;
  margin: 8px 0;
}
.sheet-equation b {
  border: 1px dashed var(--ink);
  padding: 6px 0;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.sheet-equation b:last-child {
  background: var(--ink);
  color: white;
}
.sheet-total .sheet-time {
  font-size: 15px;
  margin-top: 8px;
}
@media (max-width: 600px) {
  .panel:has(.pom-tool) {
    padding: 9px;
  }
  .pom-sheet {
    grid-template-columns: minmax(0, 1.85fr) minmax(0, 1fr);
  }
  .sheet-memo {
    border-top: 0;
    border-left: 2px solid var(--ink);
  }
  .pom-sheet .timer-todo label {
    font-size: 14px;
    grid-template-columns: 20px minmax(0, 1fr);
    gap: 4px;
  }
  .pom-sheet button {
    padding: 6px;
    font-size: 13px;
  }
  .pom-sheet input,
  .pom-sheet select {
    padding: 5px;
  }
  .sheet-memo small {
    font-size: 12px;
  }
}
.hero-morgana {
  width: clamp(115px, 32%, 310px);
  height: auto;
  flex: none;
  filter: drop-shadow(2px 1px 0 white) drop-shadow(-1px -1px 0 white);
}
.hero:before {
  clip-path: polygon(92% 0, 100% 0, 100% 100%, 60% 100%);
}
@media (max-width: 590px) {
  .hero-morgana {
    width: 31%;
  }
  .hero > div {
    min-width: 0;
  }
}
.pom-stage {
  position: relative;
  overflow: hidden;
  padding: 6px 0 8px;
}
.pom-stage .pom-face {
  margin: 8px auto;
}

.tool-entry {
  min-width: 0;
  align-self: start;
}
.tool-menu {
  border: 2px solid var(--ink);
  border-top: 0;
  background: var(--paper);
  padding: 0 16px;
  box-shadow: 3px 3px var(--ink);
}
.tool-menu summary {
  cursor: pointer;
  padding: 10px 0;
  min-height: 44px;
  font-weight: 600;
}
.tool-menu summary:focus-visible {
  outline: 3px solid var(--red);
}
.tool-menu ul {
  margin: 0;
  padding: 0 0 12px 20px;
}
.tool-menu li {
  padding: 5px 0;
}
.tool-menu a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.tool-menu a::after {
  content: "↗";
  font-size: 0.85em;
  color: var(--red);
  text-decoration: none;
}
.tool-menu ul.tool-feature-tags {
  list-style: none;
  padding: 0 0 12px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tool-menu ul.tool-feature-tags li {
  padding: 0;
}
.tool-menu ul.tool-feature-tags span {
  display: inline-block;
  padding: 3px 9px;
  font-size: 13px;
  color: #463f41;
  background: #f1eae0;
  border: 1px solid #c7bdb5;
}
@media (min-width: 591px) and (max-width: 1099px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.record-edit {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 14px;
  padding: 7px 16px;
  border: 2px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 3px 3px var(--ink);
  font-weight: 700;
  text-decoration: none;
}
.record-edit:hover {
  background: var(--ink);
  color: var(--paper);
}
.record-edit:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px var(--ink);
}

.card {
  grid-template-columns: 56px 1fr;
}
.tool-icon {
  grid-row: span 2;
  width: 56px;
  height: 56px;
  object-fit: contain;
  background: transparent;
  padding: 0;
}

.tool-icon {
  display: block;
  background-image: url(../tool-icons-v3.png);
  background-size: 300% 300%;
  background-repeat: no-repeat;
  background-color: transparent;
  padding: 0;
}
.quadrant-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.quadrant-cell {
  border: 2px solid var(--ink);
  padding: 12px;
  min-width: 0;
  min-height: 160px;
  background: var(--paper);
}
.quadrant-cell h4 {
  margin: 0 0 12px;
  color: var(--red);
}
.quadrant-cell ul {
  padding-left: 20px;
  overflow-wrap: anywhere;
}
.quadrant-cell p {
  font-size: 13px;
}
.quadrant-cell li {
  margin-bottom: 10px;
}
form section > h3 {
  margin-top: 24px;
}

.quadrant-cell ul {
  list-style: none;
  padding-left: 0;
}
.quadrant-task {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-weight: 400;
  margin: 0;
  cursor: pointer;
}
.quadrant-task input {
  width: 20px;
  height: 20px;
  flex: none;
  margin: 3px 0;
  accent-color: var(--red);
}
.quadrant-task input:checked + span {
  text-decoration: line-through;
  opacity: 0.6;
}
form textarea[hidden] {
  display: none;
}

.mindful-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:clamp(.6rem,2vw,1.25rem); margin:1rem 0; }
.mindful-card { display:flex; flex-direction:column; align-items:flex-start; gap:.85rem; justify-content:center; padding:clamp(.8rem,3vw,1.6rem); background:var(--paper); color:var(--ink); border:2px solid var(--ink); box-shadow:3px 3px var(--ink); text-decoration:none; font-size:clamp(1rem,2vw,1.25rem); font-weight:750; line-height:1.5; }
.mindful-card img { width:clamp(68px,18vw,104px); height:clamp(68px,18vw,104px); object-fit:contain; }
.mindful-card:is(:hover,:focus-visible) { border-color:var(--red); box-shadow:3px 3px var(--red); }
.mindful-all { display:inline-block; padding:.65rem 0; color:var(--ink); text-underline-offset:.2em; }

.mindful-choice {display:block;line-height:1.6;padding:1rem .25rem;border-bottom:1px solid #b9b3ac;color:var(--ink);text-decoration:none;}
.mindful-choice span {font-size:.95rem;color:#5c5051;}
.mindful-choice:is(:hover,:focus-visible) strong {color:var(--red);text-decoration:underline;}
.mindful-list audio,.mindful-list textarea {width:100%;box-sizing:border-box;}
.mindful-list label {display:block;margin-bottom:.6rem;}
