:root {
  color-scheme: light;
  --moss-950: #082a25;
  --moss-900: #0b342d;
  --moss-800: #13483d;
  --moss-700: #1f6253;
  --jade-500: #2d8a72;
  --gold-500: #e8aa3d;
  --gold-300: #f6d287;
  --fur-50: #fffaf0;
  --paper: #ffffff;
  --mist: #edf3f0;
  --mist-strong: #d9e6e0;
  --ink: #18312b;
  --muted: #61756f;
  --danger: #b54e3d;
  --shadow-soft: 0 12px 32px rgba(8, 42, 37, 0.10);
  --shadow-card: 0 5px 16px rgba(8, 42, 37, 0.07);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--mist);
  font-family: ui-rounded, "SF Pro Rounded", "PingFang TC", "Noto Sans TC", system-ui, sans-serif;
  color: var(--ink);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(circle at 14% 7%, rgba(246, 210, 135, 0.32), transparent 19rem),
    var(--mist);
}

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

button {
  -webkit-tap-highlight-color: transparent;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(232, 170, 61, 0.58);
  outline-offset: 2px;
}

.app-shell {
  position: relative;
  width: min(100%, 520px);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding-bottom: calc(26px + env(safe-area-inset-bottom));
  background: #f5f8f6;
  box-shadow: 0 0 0 1px rgba(8, 42, 37, 0.04), 0 0 60px rgba(8, 42, 37, 0.10);
  overflow: hidden;
}

.hero {
  position: relative;
  min-height: 206px;
  padding: calc(28px + env(safe-area-inset-top)) max(22px, env(safe-area-inset-right)) 30px max(22px, env(safe-area-inset-left));
  display: grid;
  grid-template-columns: 84px 1fr;
  align-items: center;
  gap: 16px;
  color: var(--fur-50);
  background:
    radial-gradient(circle at 12% 18%, rgba(246, 210, 135, 0.21), transparent 9rem),
    linear-gradient(145deg, var(--moss-900), var(--moss-950));
  border-radius: 0 0 34px 34px;
  overflow: hidden;
  isolation: isolate;
}

.hero::after {
  content: "";
  position: absolute;
  right: -26px;
  bottom: -51px;
  width: 150px;
  height: 150px;
  border: 1px solid rgba(246, 210, 135, 0.18);
  border-radius: 50%;
  box-shadow: 0 0 0 18px rgba(246, 210, 135, 0.035), 0 0 0 44px rgba(246, 210, 135, 0.025);
  z-index: -1;
}

.hero-orbit {
  position: absolute;
  top: 19px;
  left: 27px;
  width: 78px;
  height: 78px;
  border: 1px solid rgba(246, 210, 135, 0.52);
  border-radius: 50%;
  transform: translate(-10px, 0);
  box-shadow: 0 0 0 9px rgba(232, 170, 61, 0.06);
}

.hero-orbit::before,
.hero-orbit::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold-300);
  box-shadow: 0 0 11px var(--gold-300);
}

.hero-orbit::before {
  top: 7px;
  right: 8px;
}

.hero-orbit::after {
  left: -5px;
  bottom: 14px;
}

.chapi-avatar {
  position: relative;
  z-index: 1;
  width: 84px;
  height: 84px;
  object-fit: contain;
  filter: drop-shadow(0 9px 15px rgba(0, 0, 0, 0.24));
}

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

.eyebrow {
  margin: 0 0 4px;
  color: var(--gold-300);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.12em;
}

.hero h1 {
  margin: 0;
  font-family: "PingFang TC", "Noto Sans TC", system-ui, sans-serif;
  font-size: clamp(32px, 9vw, 40px);
  line-height: 1.08;
  font-weight: 820;
  letter-spacing: -0.045em;
}

.summary {
  margin: 8px 0 0;
  color: rgba(255, 250, 240, 0.74);
  font-size: 14px;
}

.prototype-badge {
  position: absolute;
  top: calc(18px + env(safe-area-inset-top));
  right: 20px;
  padding: 7px 11px;
  border: 1px solid rgba(255, 250, 240, 0.2);
  border-radius: 999px;
  color: rgba(255, 250, 240, 0.72);
  background: rgba(255, 255, 255, 0.06);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

main {
  position: relative;
  z-index: 2;
  margin-top: -18px;
}

.surface-switcher {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 0 18px 12px;
  padding: 4px;
  background: rgba(247, 250, 248, .96);
  border: 1px solid rgba(15, 64, 55, .11);
  border-radius: 16px;
  box-shadow: 0 9px 24px rgba(9, 54, 46, .11);
}
.surface-switcher-link {
  appearance: none;
  min-height: 42px;
  display: grid;
  place-items: center;
  color: var(--moss-700);
  border: 0;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
}
.surface-switcher-link.is-active {
  color: white;
  background: var(--moss-800);
}
.surface-switcher-link:focus-visible {
  outline: 3px solid var(--gold-500);
  outline-offset: 2px;
}

.surface-panel[hidden] {
  display: none !important;
}

.toolbar {
  padding: 0 18px 18px;
}

.search-box {
  min-height: 58px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(8, 42, 37, 0.06);
  border-radius: 19px;
  background: var(--paper);
  box-shadow: var(--shadow-soft);
}

.search-box svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--moss-700);
  stroke-linecap: round;
  stroke-width: 2;
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  color: var(--ink);
  background: transparent;
  font-size: 16px;
}

.search-box:focus-within {
  border-color: rgba(232, 170, 61, 0.72);
  box-shadow: 0 0 0 3px rgba(232, 170, 61, 0.17), var(--shadow-soft);
}

.search-box input:focus-visible {
  outline: none;
}

.search-box input::placeholder {
  color: #84958f;
}

.preview-notice {
  margin-top: 14px;
  padding: 11px 14px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  border: 1px solid #f0d69f;
  border-radius: 14px;
  color: #735b2d;
  background: #fff8e8;
  font-size: 13px;
  line-height: 1.5;
}

.preview-notice strong {
  color: #8b641d;
  font-size: 13px;
  white-space: nowrap;
}

.preview-notice[data-kind="connected"] {
  border-color: #b9d8ca;
  color: #315f52;
  background: #eef8f3;
}

.preview-notice[data-kind="connected"] strong {
  color: var(--moss-700);
}

.preview-notice[data-kind="error"] {
  border-color: #ecc6be;
  color: #80483e;
  background: #fff3f0;
}

.preview-notice[data-kind="error"] strong {
  color: var(--danger);
}

.category-controls {
  min-height: 32px;
  margin-top: 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--moss-800);
  font-size: 12px;
  font-weight: 780;
}

.manage-categories-button {
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  color: var(--moss-700);
  background: #e6f0ec;
  font-size: 12px;
  font-weight: 760;
  cursor: pointer;
}

.filter-row {
  display: flex;
  gap: 8px;
  margin-top: 6px;
  padding: 2px 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.filter-row::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 7px 14px;
  border: 1px solid var(--mist-strong);
  border-radius: 999px;
  color: var(--moss-800);
  background: rgba(255, 255, 255, 0.68);
  font-size: 13px;
  font-weight: 720;
  cursor: pointer;
}

.filter-chip.is-active {
  border-color: var(--moss-800);
  color: var(--fur-50);
  background: var(--moss-800);
  box-shadow: 0 5px 12px rgba(19, 72, 61, 0.16);
}

.pins-section {
  padding: 0 18px;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-heading > div {
  min-width: 0;
}

.section-heading .eyebrow {
  margin-bottom: 4px;
  color: var(--moss-700);
}

.section-heading h2 {
  margin: 0;
  font-size: 23px;
  letter-spacing: -0.025em;
}

.visible-count {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.pin-list {
  position: relative;
  display: grid;
  gap: 17px;
  padding-left: 17px;
}


.pin-card {
  position: relative;
  padding: 19px;
  border: 1px solid rgba(8, 42, 37, 0.07);
  border-radius: 22px;
  background: var(--paper);
  box-shadow: var(--shadow-card);
  animation: card-in 240ms ease-out both;
}

.pin-card.is-favorite {
  border-color: rgba(218, 164, 54, 0.42);
  box-shadow: 0 12px 30px rgba(151, 108, 22, 0.12);
}

.pin-card::before {
  content: "";
  position: absolute;
  top: 22px;
  left: -17px;
  width: 9px;
  height: 9px;
  border: 3px solid #f5f8f6;
  border-radius: 50%;
  background: var(--gold-500);
  box-shadow: 0 0 0 1px rgba(232, 170, 61, 0.34);
}

.card-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.category-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 7px;
  color: var(--moss-700);
  font-size: 11px;
  font-weight: 780;
  letter-spacing: 0.08em;
}

.category-label::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--category-color, var(--gold-500));
  transform: rotate(45deg);
}

.pin-title {
  margin: 0;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.36;
  letter-spacing: -0.018em;
}

.pin-details {
  margin: 8px 0 0;
  color: #526861;
  font-size: 16px;
  line-height: 1.72;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.pin-attachment-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.pin-attachment-grid.is-single {
  grid-template-columns: 1fr;
}

.pin-image-button {
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(8, 42, 37, 0.08);
  border-radius: 14px;
  background: var(--mist);
  cursor: zoom-in;
}

.pin-image-button img {
  width: 100%;
  height: 126px;
  display: block;
  object-fit: cover;
}

.pin-attachment-grid.is-single .pin-image-button img {
  height: auto;
  max-height: 230px;
}

.checklist {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

.checklist-row {
  min-height: 44px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.checklist-item {
  min-width: 0;
  min-height: 40px;
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: center;
  gap: 9px;
  color: #435b54;
  font-size: 16px;
  line-height: 1.45;
}

.checklist-item input {
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: var(--moss-700);
}

.checklist-item-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.checklist-item-title {
  min-width: 0;
}

.checklist-item-description {
  display: -webkit-box;
  overflow: hidden;
  color: #788b84;
  font-size: 13px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.checklist-item input:checked + .checklist-item-copy .checklist-item-title {
  color: #8a9994;
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
}

.checklist-item input:checked + .checklist-item-copy .checklist-item-description {
  color: #a1aca8;
}

.item-attachment-summary {
  position: relative;
  width: 54px;
  height: 42px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(8, 42, 37, 0.1);
  border-radius: 11px;
  background: var(--mist);
  cursor: zoom-in;
}

.item-attachment-summary img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.item-attachment-summary span {
  position: absolute;
  right: 3px;
  bottom: 3px;
  padding: 2px 5px;
  border-radius: 999px;
  color: #fff;
  background: rgba(8, 42, 37, 0.82);
  font-size: 9px;
  font-weight: 780;
}

.checklist-progress {
  display: inline-flex;
  margin-top: 10px;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--moss-700);
  background: var(--mist);
  font-size: 11px;
  font-weight: 750;
}

.pin-date {
  display: block;
  margin-top: 12px;
  color: #8a9994;
  font-size: 11px;
}

.card-menu {
  flex: 0 0 auto;
  display: flex;
  gap: 4px;
}

.card-action {
  width: 44px;
  height: 44px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 12px;
  color: var(--moss-700);
  background: var(--mist);
  cursor: pointer;
}

.card-action svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card-action.archive {
  color: var(--danger);
  background: #fbefec;
}

.card-action.favorite.is-active {
  color: #9a6814;
  background: #fff1c8;
}

.card-action.favorite.is-active svg {
  fill: currentColor;
}

@media (max-width: 560px) {
  .card-topline {
    flex-wrap: wrap;
  }

  .card-menu {
    width: 100%;
    justify-content: flex-end;
  }
}

.add-pin-button {
  position: relative;
  z-index: 3;
  width: calc(100% - 36px);
  min-height: 80px;
  margin: 0 auto 28px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid rgba(246, 210, 135, 0.46);
  border-radius: 20px;
  color: var(--fur-50);
  background: var(--moss-900);
  box-shadow: 0 14px 28px rgba(8, 42, 37, 0.28);
  cursor: pointer;
}

.add-pin-mascot {
  width: 58px;
  height: 58px;
  object-fit: contain;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.2));
}

.add-pin-copy {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 1px;
  text-align: left;
}

.add-pin-plus {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  margin-left: auto;
  color: var(--gold-300);
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  pointer-events: none;
}

.add-pin-copy strong {
  font-size: 17px;
  font-weight: 820;
  line-height: 1.2;
}

.add-pin-copy small {
  color: var(--gold-300);
  font-size: 12px;
  font-weight: 680;
  letter-spacing: 0.03em;
}

dialog {
  width: min(calc(100% - 16px), 504px);
  max-width: none;
  margin: auto auto 0;
  padding: 0;
  border: 0;
  border-radius: 24px 24px 0 0;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 -16px 42px rgba(8, 42, 37, 0.18);
}

dialog::backdrop {
  background: rgba(5, 24, 21, 0.55);
  backdrop-filter: blur(3px);
}

.pin-dialog form,
.category-dialog form,
.confirm-dialog form {
  padding: 11px 20px calc(20px + env(safe-area-inset-bottom));
}

.pin-dialog form,
.category-dialog form {
  max-height: min(88dvh, 820px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.sheet-handle {
  width: 76px;
  height: 28px;
  margin: -7px auto 7px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  touch-action: none;
  cursor: grab;
}

.sheet-handle::before {
  content: "";
  width: 42px;
  height: 5px;
  border-radius: 999px;
  background: #c5d2cd;
}

.sheet-handle:active {
  cursor: grabbing;
}

dialog.is-dragging {
  transition: none !important;
}

dialog.is-snap-back {
  transition: transform 200ms cubic-bezier(.22, .8, .3, 1);
}

.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.dialog-heading h2,
.confirm-dialog h2 {
  margin: 0;
  font-size: 23px;
  letter-spacing: -0.035em;
}

.icon-button {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  color: var(--moss-800);
  background: var(--mist);
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 15px;
  color: var(--moss-800);
  font-size: 13px;
  font-weight: 760;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--mist-strong);
  border-radius: 14px;
  color: var(--ink);
  background: #fbfdfc;
  font-size: 16px;
}

.field input,
.field select {
  min-height: 48px;
  padding: 0 13px;
}

/* iOS native menulist can paint a thin pill despite min-height. Keep the real
   select and native picker, but give its closed face the same height as inputs. */
.field select {
  -webkit-appearance: none;
  appearance: none;
  height: 52px;
  min-height: 52px;
  padding: 12px 42px 12px 14px;
  line-height: 1.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%232b6554' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px 16px;
}

.field textarea {
  min-height: 124px;
  padding: 12px 13px;
  line-height: 1.55;
  resize: vertical;
}

.field-hint {
  color: var(--muted);
  font-size: 11px;
  font-weight: 520;
  line-height: 1.5;
}

.field-heading {
  margin-bottom: 10px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  color: var(--moss-800);
  font-size: 13px;
  font-weight: 760;
}

.field-heading > div {
  display: grid;
  gap: 3px;
}

.field-heading small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 520;
}

.text-button {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--mist-strong);
  border-radius: 10px;
  color: var(--moss-700);
  background: var(--paper);
  font-size: 12px;
  font-weight: 760;
  cursor: pointer;
}

.image-picker {
  min-height: 48px;
  padding: 0 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px dashed #b9cec5;
  border-radius: 14px;
  color: var(--moss-700);
  background: #fbfdfc;
  font-size: 14px;
  font-weight: 720;
  cursor: pointer;
}

.image-picker:focus-within {
  border-color: var(--gold-500);
  box-shadow: 0 0 0 3px rgba(232, 170, 61, 0.17);
}

.image-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.image-picker > span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--gold-500);
  background: var(--fur-50);
  font-size: 20px;
  font-weight: 500;
}

.attachment-draft-list,
.builder-attachments {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.attachment-draft {
  position: relative;
  min-width: 0;
  aspect-ratio: 1;
  margin: 0;
  overflow: visible;
  border-radius: 11px;
  background: var(--mist);
}

.attachment-draft img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 11px;
  object-fit: cover;
}

.attachment-draft button {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 2px solid var(--paper);
  border-radius: 50%;
  color: #fff;
  background: var(--danger);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.checklist-fields {
  margin-bottom: 16px;
}

.checklist-builder {
  display: grid;
  gap: 10px;
}

.checklist-builder-item {
  padding: 10px;
  border: 1px solid var(--mist-strong);
  border-radius: 15px;
  background: #fbfdfc;
}

.builder-item-row {
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 7px;
}

.builder-item-number {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--moss-700);
  background: var(--mist);
  font-size: 11px;
  font-weight: 800;
}

.builder-item-row input {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 0 10px;
  border: 1px solid #cddbd5;
  border-radius: 11px;
  color: var(--ink);
  background: var(--paper);
  font-size: 15px;
}

.builder-remove-item {
  width: 44px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  background: var(--mist);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.builder-remove-item.is-locked {
  color: #758780;
  background: #eef3f1;
  font-size: 10px;
  font-weight: 760;
}

.builder-description-field {
  margin: 8px 0 0 32px;
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.4;
}

.builder-description-field textarea {
  width: 100%;
  min-height: 58px;
  padding: 8px 10px;
  border: 1px solid #d5e0db;
  border-radius: 10px;
  color: var(--ink);
  background: var(--paper);
  font-size: 13px;
  line-height: 1.45;
  resize: vertical;
}

.builder-photo-row {
  margin: 8px 0 0 32px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.item-image-picker {
  position: relative;
  min-height: 34px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px dashed #b9cec5;
  border-radius: 10px;
  color: var(--moss-700);
  background: var(--paper);
  font-size: 11px;
  font-weight: 760;
  cursor: pointer;
}

.item-image-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.item-image-picker:focus-within {
  border-color: var(--gold-500);
  box-shadow: 0 0 0 3px rgba(232, 170, 61, 0.17);
}

.item-image-picker span {
  color: var(--gold-500);
  font-size: 15px;
}

.builder-photo-count {
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.builder-attachments {
  margin: 9px 0 0 32px;
}

.form-note {
  margin: 3px 0 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.draft-favorite { display: flex; position: relative; align-items: center; gap: 9px; width: fit-content; min-height: 44px; margin: 0 0 10px; color: #746954; cursor: pointer; font-size: 14px; }
.draft-favorite[hidden] { display: none !important; }
.draft-favorite input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.draft-favorite svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; flex-shrink: 0; }
.draft-favorite input:checked ~ svg { color: #a87722; fill: #f4d68b; }
.draft-favorite input:checked ~ span { color: #806026; }
.draft-favorite input:focus-visible ~ svg { outline: 2px solid #8b6637; outline-offset: 4px; border-radius: 3px; }
.draft-favorite:has(input:disabled) { opacity: .6; cursor: default; }

.dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1.45fr;
  gap: 10px;
}

.button {
  min-height: 50px;
  padding: 0 16px;
  border-radius: 15px;
  font-weight: 800;
  cursor: pointer;
}

.button-secondary {
  border: 1px solid var(--mist-strong);
  color: var(--moss-800);
  background: var(--paper);
}

.button-primary {
  border: 1px solid var(--moss-900);
  color: var(--fur-50);
  background: var(--moss-900);
}

.button-danger {
  border: 1px solid var(--danger);
  color: #fff;
  background: var(--danger);
}

.button-full {
  width: 100%;
}

.category-dialog-intro {
  margin: -5px 0 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.category-list {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.category-edit-row {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto 44px;
  align-items: center;
  gap: 9px;
}

.category-list-empty {
  margin: 0;
  padding: 14px 12px;
  color: var(--muted);
  text-align: center;
}

.category-dot {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  background: var(--dot-color, var(--gold-500));
  transform: rotate(45deg);
}

.category-edit-row input,
.category-add-row input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0 11px;
  border: 1px solid var(--mist-strong);
  border-radius: 12px;
  color: var(--ink);
  background: #fbfdfc;
  font-size: 15px;
}

.category-edit-row button {
  min-height: 40px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  color: var(--moss-700);
  background: var(--mist);
  font-size: 12px;
  font-weight: 760;
  cursor: pointer;
}

#notebookSurface .category-edit-row .category-delete-button {
  width: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  display: grid;
  place-items: center;
  color: #914e43;
  background: #f6eeea;
}
.category-delete-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.category-fixed-label { grid-column: 3 / 5; color: var(--muted); font-size: 12px; white-space: nowrap; }
.category-edit-row input:disabled { opacity: .65; }
#categoryDeleteStatus { font-size: 13px; line-height: 1.6; }
#categoryDeleteDialog .dialog-actions { flex-wrap: wrap; }
#categoryDeleteDialog .button[hidden] { display: none; }

.category-add-field {
  padding-top: 15px;
  border-top: 1px solid var(--mist);
}

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

.category-add-row .button {
  min-height: 44px;
  padding: 0 10px;
  border-radius: 12px;
}

.confirm-dialog {
  width: min(calc(100% - 32px), 420px);
  margin: auto;
  overflow: hidden;
  border-radius: 24px;
  text-align: center;
}

.confirm-dialog form {
  max-height: calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  padding: 28px 24px calc(24px + env(safe-area-inset-bottom));
  overflow-y: auto;
}

.confirm-dialog p {
  margin: 10px 0 22px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.confirm-symbol {
  width: 54px;
  height: 54px;
  margin: 0 auto 13px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--danger);
  background: #fbefec;
}

.confirm-symbol svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.confirm-dialog .button {
  min-height: 48px;
}

.content-link {
  color: var(--moss-700);
  font-weight: 650;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

.image-lightbox {
  width: min(calc(100% - 28px), 500px);
  margin: auto;
  overflow: visible;
  border-radius: 20px;
  background: #071d19;
  box-shadow: 0 18px 56px rgba(0, 0, 0, 0.42);
}

.image-lightbox form {
  position: relative;
  padding: 12px;
}

.image-lightbox img {
  width: 100%;
  max-height: min(72dvh, 650px);
  display: block;
  border-radius: 13px;
  object-fit: contain;
  background: #061512;
}

.lightbox-close {
  position: absolute;
  z-index: 1;
  top: -11px;
  right: -9px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.66);
  border-radius: 50%;
  color: #fff;
  background: var(--moss-900);
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
}

.lightbox-footer {
  min-height: 44px;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  font-weight: 720;
  text-align: center;
}

.lightbox-footer button {
  width: 40px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  font-size: 19px;
  cursor: pointer;
}

.toast {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: calc(91px + env(safe-area-inset-bottom));
  max-width: calc(100% - 40px);
  padding: 11px 16px;
  border-radius: 12px;
  color: var(--fur-50);
  background: rgba(8, 42, 37, 0.94);
  box-shadow: var(--shadow-soft);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.has-action {
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: auto;
}

.toast.has-action button {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 9px;
  color: var(--moss-950);
  background: var(--gold-300);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.empty-state {
  padding: 36px 24px;
  border: 1px dashed #cad9d2;
  border-radius: 20px;
  text-align: center;
  background: rgba(255, 255, 255, 0.56);
}

.empty-orbit {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  border: 1px solid var(--gold-300);
  border-radius: 50%;
  color: var(--gold-500);
  background: var(--fur-50);
}

.empty-state h3 {
  margin: 0;
  font-size: 17px;
}

.empty-state p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.status-action {
  min-height: 44px;
  margin-top: 16px;
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (min-width: 521px) {
  body {
    padding: 20px 0;
  }

  .app-shell {
    min-height: calc(100vh - 40px);
    border-radius: 28px;
  }

  .hero {
    border-radius: 28px 28px 0 0;
  }

  .add-pin-button {
    width: calc(100% - 36px);
  }

  dialog {
    margin-bottom: 20px;
    border-radius: 24px;
  }
}

@media (min-width: 700px) and (max-width: 999px) {
  .app-shell {
    width: min(720px, calc(100% - 40px));
  }

  .toolbar,
  .pins-section {
    padding-right: 28px;
    padding-left: 28px;
  }

  .surface-switcher {
    margin-right: 28px;
    margin-left: 28px;
  }

  .add-pin-button {
    width: calc(100% - 56px);
  }

  .pin-attachment-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1000px) {
  body {
    padding: 24px;
  }

  .app-shell {
    width: min(1180px, calc(100% - 16px));
    min-height: calc(100vh - 48px);
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    align-items: stretch;
    padding-bottom: 0;
    border-radius: 28px;
    overflow: clip;
  }

  .hero {
    grid-column: 1;
    grid-row: 1;
    min-height: calc(100vh - 48px);
    padding: 52px 34px 40px;
    grid-template-columns: 1fr;
    align-content: start;
    align-items: start;
    gap: 26px;
    border-radius: 28px 0 0 28px;
  }

  .hero-orbit {
    top: 41px;
    left: 42px;
    width: 112px;
    height: 112px;
  }

  .chapi-avatar {
    width: 126px;
    height: 126px;
  }

  .hero h1 {
    max-width: 4em;
    font-size: 44px;
    line-height: 1.1;
  }

  .summary {
    max-width: 15em;
    margin-top: 12px;
    line-height: 1.65;
  }

  .prototype-badge {
    top: 22px;
    right: 22px;
  }

  main {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    margin-top: 0;
    padding: 34px;
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    align-items: start;
    gap: 28px;
  }

  .surface-switcher {
    margin-right: 0;
    margin-left: 0;
  }

  .workspace-controls {
    position: sticky;
    top: 58px;
  }

  .toolbar,
  .pins-section {
    padding: 0;
  }

  .preview-notice {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .filter-row {
    flex-wrap: wrap;
    overflow: visible;
  }

  .add-pin-button {
    width: 100%;
    margin: 18px 0 0;
  }

  .pin-list {
    gap: 15px;
  }

  .pin-card {
    padding: 19px 18px 17px;
  }

  dialog {
    margin: auto;
    border-radius: 24px;
  }
}

/* 2026-08-27 paired visual system: orderly notebook */
.hero {
  min-height: 218px;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 14px;
  background-color: #082f29;
  background-image:
    repeating-linear-gradient(0deg, rgba(246, 210, 135, 0.045) 0 1px, transparent 1px 19px),
    radial-gradient(circle at 14% 20%, rgba(232, 185, 74, 0.18), transparent 10rem);
}

.hero::before {
  content: "";
  position: absolute;
  top: 47px;
  right: 25px;
  width: 92px;
  height: 116px;
  border-left: 1px solid rgba(246, 210, 135, 0.18);
  border-right: 1px solid rgba(246, 210, 135, 0.08);
  background: repeating-linear-gradient(0deg, transparent 0 18px, rgba(246, 210, 135, 0.13) 18px 19px);
  opacity: 0.74;
  transform: rotate(2deg);
  z-index: -1;
}

.hero::after {
  right: -22px;
  bottom: -54px;
  width: 158px;
  height: 158px;
  box-shadow: 0 0 0 18px rgba(246, 210, 135, 0.035), 0 0 0 44px rgba(246, 210, 135, 0.025);
}

.hero-orbit {
  top: 48px;
  left: 24px;
  width: 102px;
  height: 102px;
  transform: none;
  opacity: 0.62;
}

.hero-character {
  position: relative;
  z-index: 1;
  width: 112px;
  height: 112px;
  display: block;
}

.chapi-avatar {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 9px 15px rgba(0, 0, 0, 0.24));
}

.hero-copy {
  position: relative;
  z-index: 1;
}

.add-pin-mascot-picture {
  flex: 0 0 58px;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
}

.add-pin-mascot {
  width: 58px;
  height: 58px;
}

@media (max-width: 360px) {
  .hero {
    grid-template-columns: 100px minmax(0, 1fr);
    gap: 10px;
    padding-right: 18px;
    padding-left: 18px;
  }

  .hero-character {
    width: 100px;
    height: 100px;
  }

  .hero h1 {
    font-size: 32px;
  }
}

@media (min-width: 1000px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero-character {
    width: 154px;
    height: 154px;
  }

  .hero-orbit {
    top: 48px;
    left: 39px;
    width: 132px;
    height: 132px;
  }
}

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

/* Frameless, centered gallery stage shared with the swipe interaction in shell.js. */
.image-lightbox {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.image-lightbox::backdrop {
  background: rgba(1, 13, 11, 0.88);
  backdrop-filter: blur(5px);
}

.image-lightbox form {
  width: 100%;
  height: 100%;
  min-height: 0;
  padding:
    max(54px, calc(20px + env(safe-area-inset-top)))
    max(14px, env(safe-area-inset-right))
    max(18px, env(safe-area-inset-bottom))
    max(14px, env(safe-area-inset-left));
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  place-items: center;
  touch-action: none;
}

.image-lightbox img {
  width: auto;
  max-width: 100%;
  max-height: 100%;
  align-self: center;
  object-fit: contain;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  touch-action: none;
  user-select: none;
  -webkit-user-drag: none;
}

.image-lightbox .lightbox-close {
  position: fixed;
  z-index: 2;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: rgba(2, 28, 23, 0.66);
  backdrop-filter: blur(8px);
}

.image-lightbox .lightbox-footer {
  width: min(220px, calc(100vw - 40px));
  min-height: 44px;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 12px;
  font-weight: 720;
  text-align: center;
}

.image-lightbox .lightbox-footer button {
  width: 40px;
  height: 38px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 12px;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  font-size: 19px;
}

/* Same completed-entry and reading hierarchy as Quick Capture. */
.pin-card .card-topline { flex-wrap:nowrap; align-items:flex-start; }
.card-topline > div { min-width:0; }
.entry-heading { display:flex; flex-wrap:wrap; align-items:center; gap:8px 10px; margin-bottom:9px; }
.entry-heading .category-label { font-size:13px; letter-spacing:0; }
.pin-title { font-size:18px; font-weight:750; line-height:1.45; overflow-wrap:anywhere; }
.pin-card.is-completed { background:#e6f0e9; border-color:#b4cdbd; border-left:4px solid #27644f; box-shadow:0 3px 12px rgba(13,57,49,.025); }
.pin-card.is-completed::before { background:#27644f; }
.pin-card.is-completed .pin-details { color:#314f43; }
.pin-date, .pin-completed-time { display:block; margin-top:12px; font-size:13px; line-height:1.6; color:#586b64; }
.pin-completed-time { margin-top:4px; color:#27644f; }
.entry-footer { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:4px; border-top:1px solid #dce5df; margin-top:17px; padding-top:10px; }
.entry-footer .card-menu { width:auto; gap:2px; }
.pin-card .card-action { flex:0 0 auto; width:44px; height:44px; border-radius:50%; background:transparent; color:#586b64; }
.pin-card .card-action svg { width:20px; height:20px; stroke-width:1.8; }
.pin-card .card-action:hover { background:#eaf1ed; color:#153f36; }
.pin-card .card-action:focus-visible { outline:3px solid #a87722; outline-offset:2px; }
.pin-card .card-action:disabled { opacity:.55; cursor:wait; }
.pin-card .card-action.archive:hover { background:#fbefed; color:#a84740; }
.pin-card .card-action.favorite.is-active { color:#a87722; }
.pin-card .card-action.favorite.is-active { background:transparent; }
.pin-card .card-action.favorite.is-active svg { fill:#f4d68b; }
.pin-card .card-action.completion { display:inline-flex; align-items:center; justify-content:center; gap:6px; width:auto; padding:0 10px; border-radius:22px; background:#27644f; color:white; font-size:14px; font-weight:700; white-space:nowrap; }
.pin-card .card-action.completion.is-active { background:transparent; color:#27644f; }
.entry-filters { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:3px; margin-bottom:20px; padding:4px; border:1px solid #dbe5df; border-radius:15px; background:#eaf1ed; }
.entry-filters button { min-width:0; min-height:44px; padding:8px 3px; border:0; border-radius:11px; background:transparent; color:#586b64; font-size:14px; font-weight:600; cursor:pointer; white-space:nowrap; }
.entry-filters button[aria-pressed="true"] { color:#153f36; background:white; box-shadow:0 2px 6px rgba(13,57,49,.07); }
.entry-filters button:focus-visible { outline:3px solid #a87722; outline-offset:2px; }
.entry-filters span { margin-left:3px; font-size:12px; font-variant-numeric:tabular-nums; }
@media(max-width:360px) {
  .pin-card { padding:15px 13px; }
  .pin-card .card-action.completion { padding:0 8px; }
}

/* Shared reading/status contract: duplicated because each surface enables one stylesheet. */
.record-status { display:inline-flex; align-items:center; align-self:flex-start; gap:6px; padding:5px 10px; border-radius:8px; background:#fff2d4; color:#875816; font-size:14px; font-weight:700; line-height:1.5; white-space:nowrap; }
.record-status.is-completed { background:#27644f; color:#fff; }
.record-status-mark { font-size:16px; line-height:1; }
.reading-disclosure { min-width:0; scroll-margin-top:80px; }
.reading-disclosure [hidden] { display:none !important; }
.reading-preview { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:5; line-clamp:5; overflow:hidden; }
.reading-toggle { display:block; min-height:44px; padding:8px 0; border:0; background:transparent; color:#205f4d; font:inherit; font-size:14px; font-weight:700; cursor:pointer; }
.reading-toggle:focus-visible { outline:3px solid #a87722; outline-offset:2px; border-radius:4px; }
.checklist-description-reader { grid-column:1 / -1; grid-row:2; margin-left:33px; }
.checklist-row > .item-attachment-summary { grid-column:2; grid-row:1; }
.checklist-description-reader .checklist-item-description { margin:6px 0 0; white-space:pre-wrap; overflow-wrap:anywhere; font-size:16px; line-height:1.72; }
.checklist-description-reader .checklist-item-description:not(.reading-preview) { display:block; -webkit-line-clamp:unset; line-clamp:unset; }
/* Match Quick Capture's quiet, segmented status rail. */
.pin-list { gap:16px; padding-left:20px; }
.pin-card { --rail-left:-21px; }
.pin-card.is-completed { --rail-left:-24px; }
.pin-card::before {
  content:""; position:absolute; left:var(--rail-left); top:28px;
  width:12px; height:12px; box-sizing:border-box; border:1.5px solid #ae8a4d;
  border-radius:50%; background:#f6f9f7; box-shadow:none;
}
.pin-card.is-completed::before {
  content:"✓"; display:grid; place-items:center; border-color:#27644f;
  background:#27644f; color:white; font-size:9px; font-weight:800; line-height:1; box-shadow:none;
}
.pin-card:not(:last-child)::after {
  content:""; position:absolute; left:calc(var(--rail-left) + 5.5px);
  top:46px; bottom:-38px; width:1px; background:#ccd9d1; pointer-events:none;
}

/* Notebook refinement: same moss / paper palette, a quieter 4px rhythm.
   Changes stay on this surface; Quick Capture owns its own stylesheet. */
#notebookSurface .surface-switcher-link { min-height:44px; font-size:15px; }
#notebookSurface .search-box { min-height:54px; border-radius:17px; box-shadow:0 5px 18px rgba(8,42,37,.055); }
#notebookSurface .toolbar { padding-bottom:24px; }
#notebookSurface .category-controls { margin-top:0; gap:8px; font-size:13px; }
#notebookSurface .manage-categories-button { min-height:44px; padding:0 12px; font-size:13px; border-radius:12px; }
#notebookSurface .filter-row { gap:8px; margin-top:4px; }
#notebookSurface .filter-chip { min-width:44px; min-height:44px; padding:9px 15px; font-size:14px; line-height:1.4; }
#notebookSurface .add-pin-button { width:100%; min-height:72px; margin:16px 0; padding:10px 16px; gap:12px; border-radius:18px; box-shadow:0 8px 20px rgba(8,42,37,.16); }
#notebookSurface .add-pin-mascot-picture { flex-basis:48px; width:48px; height:48px; }
#notebookSurface .add-pin-mascot { width:48px; height:48px; }
#notebookSurface .add-pin-copy { gap:4px; }
#notebookSurface .add-pin-copy strong { line-height:1.4; font-weight:750; }
#notebookSurface .add-pin-copy small { font-weight:550; line-height:1.4; }
#notebookSurface .section-heading { margin-bottom:14px; }
#notebookSurface .section-heading h2 { font-size:22px; line-height:1.4; }
#notebookSurface .entry-filters { margin-bottom:16px; }
#notebookSurface .pin-card { padding:18px; border-radius:20px; }
#notebookSurface .entry-heading { gap:6px 9px; margin-bottom:8px; }
#notebookSurface .entry-heading .category-label { margin-bottom:0; line-height:1.5; }
#notebookSurface .record-status { padding:4px 9px; font-size:13px; }
#notebookSurface .pin-details,
#notebookSurface .checklist-description-reader .checklist-item-description { line-height:1.65; color:#425e54; }
#notebookSurface .pin-date { margin-top:12px; font-size:12px; line-height:1.5; }
#notebookSurface .pin-completed-time { font-size:12px; line-height:1.5; }
#notebookSurface .entry-footer { margin-top:14px; padding-top:8px; gap:4px; }
#notebookSurface .entry-footer .card-menu { gap:2px; }
#notebookSurface .checklist { gap:8px; }
#notebookSurface .checklist-item { min-height:44px; line-height:1.55; }
#notebookSurface .item-attachment-summary { min-height:44px; }
#notebookSurface .checklist-progress { padding:5px 9px; font-size:12px; line-height:1.5; }

#notebookSurface .pin-dialog form,
#notebookSurface .category-dialog form { padding:10px 20px calc(20px + env(safe-area-inset-bottom)); }
#notebookSurface .pin-dialog form { --notebook-sheet-gutter:20px; scroll-padding-bottom:100px; }
#notebookSurface .pin-dialog .dialog-actions {
  position:sticky;
  bottom:calc(-20px - env(safe-area-inset-bottom));
  z-index:4;
  margin:0 calc(-1 * var(--notebook-sheet-gutter)) calc(-20px - env(safe-area-inset-bottom));
  padding:12px var(--notebook-sheet-gutter) calc(16px + env(safe-area-inset-bottom));
  border-top:1px solid #e3ebe6;
  background:#fff;
  box-shadow:0 -8px 20px rgba(8,42,37,.045);
}
#notebookSurface .sheet-handle { height:44px; margin:-8px auto 2px; }
#notebookSurface .dialog-heading { align-items:center; gap:12px; margin-bottom:20px; }
#notebookSurface .dialog-heading h2,
#notebookSurface .confirm-dialog h2 { font-size:22px; font-weight:750; line-height:1.4; }
/* This noninteractive heading receives opening focus only. Interactive keyboard
   focus-visible styling above remains intact, including Tab after opening. */
#notebookSurface dialog h2[tabindex="-1"]:focus { outline:none; }
#notebookSurface .dialog-heading .eyebrow { margin-bottom:5px; color:#70847b; letter-spacing:.03em; font-weight:600; }
#notebookSurface .icon-button { width:44px; height:44px; flex:0 0 44px; font-size:26px; }
#notebookSurface .field { gap:8px; margin-bottom:18px; font-size:14px; font-weight:650; line-height:1.5; }
#notebookSurface .field input,
#notebookSurface .field select,
#notebookSurface .field textarea { font-weight:450; }
#notebookSurface .field textarea { line-height:1.65; }
#notebookSurface .field-hint,
#notebookSurface .field-heading small,
#notebookSurface .category-dialog-intro,
#notebookSurface .form-note { font-size:12px; line-height:1.65; font-weight:450; }
#notebookSurface .field-heading { align-items:center; gap:8px; font-size:14px; }
#notebookSurface .text-button { min-width:44px; min-height:44px; padding:0 12px; font-size:13px; white-space:nowrap; }
#notebookSurface .button { min-height:48px; border-radius:13px; font-size:16px; line-height:1.4; font-weight:650; }
#notebookSurface .category-list { gap:12px; }
#notebookSurface .category-edit-row { gap:8px; }
#notebookSurface .category-edit-row input,
#notebookSurface .category-add-row input { min-height:48px; font-size:16px; font-weight:450; }
#notebookSurface .category-edit-row button { min-width:48px; min-height:44px; font-size:13px; }
#notebookSurface .category-add-field { padding-top:18px; }
#notebookSurface .checklist-builder { gap:14px; }
#notebookSurface .builder-item-row { grid-template-columns:22px minmax(0,1fr) 44px; gap:7px; }
#notebookSurface .builder-item-row input { min-height:44px; font-size:16px; }
#notebookSurface .builder-remove-item { min-height:44px; }
#notebookSurface .builder-description-field { margin:12px 0 0; gap:6px; font-size:12px; line-height:1.5; }
#notebookSurface .builder-description-field textarea { min-height:76px; font-size:16px; font-weight:450; line-height:1.6; }
#notebookSurface .builder-photo-row { margin:10px 0 0; }
#notebookSurface .item-image-picker { min-height:44px; padding:0 12px; font-size:13px; }
#notebookSurface .builder-photo-count { font-size:12px; }
#notebookSurface .builder-attachments { margin-left:0; }
#notebookSurface .attachment-draft-list,
#notebookSurface .builder-attachments { grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
#notebookSurface .attachment-draft button { width:44px; height:44px; top:-4px; right:-4px; font-size:20px; }

@media(max-width:360px) {
  #notebookSurface .toolbar,
  #notebookSurface .pins-section { padding-left:14px; padding-right:14px; }
  #notebookSurface .surface-switcher { margin-left:14px; margin-right:14px; }
  #notebookSurface .pin-list { padding-left:16px; }
  #notebookSurface .pin-card { --rail-left:-17px; padding:15px 12px; }
  #notebookSurface .pin-card.is-completed { --rail-left:-20px; }
  #notebookSurface .pin-dialog form,
  #notebookSurface .category-dialog form { padding-left:16px; padding-right:16px; }
  #notebookSurface .pin-dialog form { --notebook-sheet-gutter:16px; }
  #notebookSurface .field-heading { align-items:flex-start; flex-wrap:wrap; }
}
