/* Desktop workspace, preserving narrow-screen usability. */
@media (min-width: 1100px) {
  .bar,
  main,
  footer {
    max-width: 1480px;
    padding-left: 48px;
    padding-right: 48px;
  }
  header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--ink);
  }
  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
  }
  .card {
    min-height: 115px;
  }
  .hero {
    min-height: 270px;
  }
  .hero-morgana {
    max-width: 280px;
  }
  .tabs {
    gap: 12px;
    margin: 24px 0;
  }
  .tabs button {
    min-height: 44px;
  }
  main > .tabs + div {
    display: grid;
    grid-template-columns: minmax(480px, 1.25fr) minmax(320px, 1fr);
    gap: 32px;
    align-items: start;
  }
  form,
  .panel {
    max-width: none;
  }
  form textarea {
    min-height: 100px;
  }
  .practice-history {
    max-height: 75vh;
    overflow: auto;
    padding: 0 8px 8px;
  }
  .practice-history h2 {
    margin-top: 0;
  }
  .paper-guide {
    grid-column: 1/-1;
    max-width: 1000px;
  }
  .pom-tool {
    display: grid;
    grid-template-columns: 360px minmax(0, 1fr);
    gap: 28px;
    align-items: start;
  }
  .pom-tool > .timer-card {
    position: sticky;
    top: 110px;
    max-height: calc(100dvh - 124px);
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scrollbar-gutter: stable;
  }
  .pom-sheet {
    margin-top: 0;
  }
  .pom-tool > :not(.timer-card):not(.pom-sheet) {
    grid-column: 2;
  }
  .quadrant-cell {
    min-height: 220px;
  }
}
.paper-guide p {
  margin: 18px 0;
  line-height: 1.9;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand-avatar {
  width: 40px;
  height: 40px;
  object-fit: contain;
}
.timer-tool details p {
  margin: 12px 0;
}

.pom-guide {
  margin: 0 0 24px;
  max-width: 1000px;
}
.pom-guide > summary {
  display: inline-block;
  cursor: pointer;
  background: var(--ink);
  color: white;
  border-left: 5px solid var(--red);
  padding: 8px 16px;
  font-weight: 700;
  min-height: 44px;
}
.pom-guide > summary::before {
  content: "＋ ";
  color: #ff3754;
}
.pom-guide[open] > summary::before {
  content: "－ ";
}
.guide-content {
  background: var(--paper);
  border: 2px solid var(--ink);
  padding: 20px;
  margin-top: 10px;
}
.guide-content details {
  margin: 12px 0;
  border-bottom: 1px solid #c9bfb8;
  padding-bottom: 12px;
}
.guide-content summary {
  cursor: pointer;
  font-weight: 700;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.guide-content p {
  margin: 10px 0;
  line-height: 1.8;
}
.guide-content small {
  color: #554d4a;
}
.guide-content ul {
  padding-left: 22px;
}
.brand-avatar {
  background: #fff;
  border-radius: 0;
  clip-path: polygon(12% 0, 100% 0, 88% 100%, 0 100%);
}

.practice-guide {
  grid-column: 1/-1;
  min-width: 0;
}
.practice-guide .guide-content h3 {
  margin: 1rem 0 0.35rem;
}
.practice-guide .guide-content p {
  margin: 0.35rem 0 1rem;
  overflow-wrap: anywhere;
}
.tool-guides {
  margin: 1.5rem 0;
}
.tool-guides .practice-guide {
  margin: 0.5rem 0;
}

.back {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 7px 22px 7px 9px;
  margin-bottom: 20px;
  background: #171519;
  color: #fffaf0;
  border: 2px solid #171519;
  box-shadow: 4px 4px 0 #e60012;
  font-weight: 800;
  transform: skew(-7deg);
}
.back::before {
  content: "←";
  display: grid;
  place-items: center;
  width: 32px;
  height: 28px;
  background: #e60012;
  color: white;
  font: bold 26px/1 system-ui;
  clip-path: polygon(25% 0, 100% 0, 85% 100%, 0 100%);
}
.back:hover {
  background: #e60012;
  text-decoration: none;
}
.back:focus-visible {
  outline: 3px solid #e60012;
  outline-offset: 6px;
}
.back:active {
  transform: skew(-7deg) translate(2px, 2px);
  box-shadow: 2px 2px 0 #e60012;
}
.flow-guide > .practice-guide {
  margin: 12px;
  border-left: 0;
}
.flow-guide > .practice-guide > summary {
  font-size: 16px;
}

.series-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1rem;
  overflow-wrap: anywhere;
}
.curiosity-series form {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: .75rem;
}
.curiosity-series label { flex: 1 1 14rem; min-width: 0; }
.sheet-urgent .timer-todo > div:first-child { flex: 1 1 8em; min-width: 0; overflow-wrap: anywhere; }
.pom-sheet :is(.sheet-urgent, .sheet-memo) > .todo-checklist { max-height: 45vh; overflow-y: auto; overscroll-behavior-y: contain; }
.urgency-decisions { display: flex; gap: .2rem; margin-top: .35rem; white-space: nowrap; }
.sheet-urgent .urgency-decisions button { padding-inline: .25em; font-size: .85rem; }
.sheet-urgent .timer-todo > div:first-child { flex-basis: 10rem; }
.sheet-urgent .timer-todo > .urgency-schedule { display: flex; flex-direction: column; align-items: flex-start; gap: .25rem; width: 8.5em; max-width: 100%; }
@media (max-width: 480px) {
  .pom-tool .pom-sheet { grid-template-columns: minmax(0, 1fr); }
}
.urgency-schedule select, .urgency-schedule textarea { width: 100%; margin: 0; box-sizing: border-box; }
.urgency-schedule textarea { max-width: 85%; min-height: 0; }
.urgency-schedule textarea[hidden] { display: none; }
.pending-records {
  grid-column: 1/-1;
  margin: 18px 0;
  padding: 18px;
  border: 2px solid #171519;
  border-left: 7px solid #e60012;
  background: #fffaf0;
}
.pending-records h2 {
  margin: 0 0 8px;
}
.pending-link {
  display: block;
  padding: 12px 0;
  font-weight: bold;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.draft-status {
  padding: 10px 12px;
  border: 1px dashed #777;
  font-size: 14px;
}
.draft-status.is-pending {
  border: 2px solid #e60012;
  border-left-width: 7px;
  font-weight: bold;
  background: #fffaf0;
}
.save-later {
  margin: 8px 0 8px 10px;
  background: #fffaf0;
  color: #171519;
  border: 2px solid #171519;
}

.todo-children { grid-column: 1 / -1; flex-basis: 100%; min-width: 0; margin-inline-start: 1rem; border-inline-start: 2px solid #b4aaa0; padding-inline-start: .75rem; }
.timer-todo:has(> .todo-children) { flex-wrap: wrap; }
.todo-children summary { cursor: pointer; }

.pom-tool .pom-estimate { display:inline-flex; align-items:center; gap:.5rem; font-size:.875rem; }
.pom-tool .pom-estimate input { width:5rem; min-width:0; }
.pom-tool .sheet-block li.timer-todo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .35rem .75rem;
  align-items: center;
}
.pom-tool .sheet-block .timer-todo > label:first-child { grid-column: 1 / -1; }
.pom-tool .sheet-block .timer-todo > .pom-estimate { display: flex; gap: .35rem; }
.pom-tool .sheet-block .pom-estimate input { width: 3.5rem; }
.daily-row { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,12rem),1fr)); gap:.75rem; min-width:0; margin:.8rem 0; border:1px solid currentColor; border-radius:.5rem; }
.daily-row label { min-width:0; }
.daily-row textarea { width:100%; box-sizing:border-box; }
nav.grid a[aria-current="page"] {
  outline: 2px solid currentColor;
}
.daily-mode-nav .card {
  grid-template-columns: 1fr;
  min-height: 64px;
  padding: 16px 20px;
  font-size: 18px;
  font-weight: 800;
  align-content: center;
}
.daily-mode-nav .card:hover {
  color: var(--ink);
  text-decoration: none;
}
.daily-mode-nav .card[aria-current="page"],
.daily-mode-nav .card[aria-current="page"]:hover {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
  border-left: 6px solid var(--red);
  box-shadow: 3px 3px var(--red);
  outline: none;
}
.timer-top-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin-bottom: 10px;
}
.timer-top-actions .record-export {
  margin: 0;
}
.timer-sound-status {
  display: block;
  margin-bottom: 8px;
  color: #463f41;
}
.timer-sound-status:empty {
  display: none;
}
select {
  display: inline-flex;
  align-items: center;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 36px;
  background-color: white;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%23171519' stroke-width='2' stroke-linecap='square' d='M1.5 1.5L6 6l4.5-4.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px 8px;
  cursor: pointer;
}
select::picker-icon {
  display: none;
}
main > select {
  width: min(100%, 320px);
  max-width: 320px;
  margin-bottom: 16px;
}
.todo-stars {
  position: fixed;
  inset: 0;
  margin: auto;
  width: 92vw;
  height: 80vh;
  height: 80dvh;
  pointer-events: none;
  z-index: 1000;
}
.todo-stars video { width: 100%; height: 100%; object-fit: cover; }
.focus-battle { position: fixed; aspect-ratio: 16 / 9; max-width: none; pointer-events: none; z-index: 1000; }
.rest-battle { position: fixed; inset: 0; width: 100%; height: 100%; object-fit: fill; pointer-events: none; z-index: 1000; }

.pom-tool .timer-controls button.comic-action {
  --frame: polygon(0 13%,68% 13%,71% 0,100% 0,97% 86%,35% 86%,32% 100%,0 100%);
  isolation: isolate;
  position: relative;
  clip-path: var(--frame);
  background: #171717;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 12px 22px;
}
.comic-action::before {
  content: "";
  position: absolute;
  inset: 3px 4px;
  clip-path: var(--frame);
  background: #fff9ef;
  z-index: -1;
}
.comic-action.focus-action::before { background: #c50830; }
.comic-action:focus-visible::before { inset: 6px 7px; }
.comic-action img { height: 1em; width: auto; vertical-align: -.14em; }

.backup-panel {
  margin: 0 0 20px;
  padding: 16px 18px;
  border-left: 7px solid var(--red);
}
.backup-panel .backup-head {
  margin-bottom: 12px;
}
.backup-panel h2 {
  margin: 0 0 4px;
  font-size: 18px;
}
.backup-panel small {
  display: block;
  color: #5a5153;
  font-size: 13px;
}
.backup-panel .actions {
  gap: 10px;
}
.backup-panel .save-later {
  margin: 0;
}
.backup-panel .status {
  margin-top: 8px;
  font-size: 14px;
}
.backup-panel input[hidden] {
  display: none;
}
