:root {
  --ink: #212121;
  --muted: #61605d;
  --bg: #f2efeb;
  --paper: #fffefa;
  --line: #212121;
  --pink: #f26695;
  --cyan: #09ccea;
  --teal: #36bfb8;
  --lime: #b6d96f;
  --yellow: #f2b035;
  --red: #b1263e;
  --soft: #e7f2cc;
  --green: #226052;
  --amber: #785200;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family:
    "Arial", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  font-size: 15px;
  line-height: 1.65;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select {
  touch-action: manipulation;
}
button {
  color: var(--ink);
  cursor: pointer;
  position: relative;
  transition:
    transform 0.18s,
    box-shadow 0.18s,
    background 0.18s;
  -webkit-tap-highlight-color: transparent;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid #00778c;
  outline-offset: 5px;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1,
h2,
h3 {
  line-height: 1.35;
}
h1 {
  font-size: clamp(34px, 3.8vw, 52px);
  letter-spacing: -0.035em;
  font-weight: 900;
  margin-bottom: 12px;
}
h2 {
  font-size: 21px;
  font-weight: 800;
  margin-bottom: 12px;
}
h3 {
  font-size: 17px;
  margin-bottom: 8px;
}
.muted,
.fine {
  color: var(--muted);
}
.fine {
  font-size: 12px;
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.13em;
  margin-bottom: 20px;
}
.live-dot,
.sync-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border: 1px solid var(--ink);
  background: var(--teal);
  border-radius: 50%;
  flex-shrink: 0;
}
.topbar {
  min-height: 100px;
  padding: 20px max(36px, calc((100vw - 1280px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.wordmark {
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -0.05em;
}
.symbol-definitions {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}
.symbol-svg {
  display: inline-block;
  width: 1em;
  height: 1em;
  fill: none;
  vertical-align: -0.125em;
  flex-shrink: 0;
}
.brand-symbol {
  display: inline-flex;
  font-size: 43px;
  line-height: 1;
  color: var(--ink);
}
.wordmark .wordmark-sub {
  font-size: 9px;
  letter-spacing: 0.12em;
  margin-left: 10px;
  font-weight: 600;
}
.identity {
  display: flex;
  gap: 14px;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
}
#identity {
  border-left: 1px solid #bcb8b0;
  padding-left: 15px;
}
.motion-toggle {
  border: 0;
  border-radius: 20px;
  background: transparent;
  padding: 9px 4px;
  font-size: 11px;
  min-height: 40px;
}
#logout {
  padding: 10px 22px;
  background: white;
  border: 1.5px solid var(--ink);
  border-radius: 40px;
  box-shadow: 3px 3px 0 var(--ink);
}
main {
  max-width: 1280px;
  padding: 0 36px;
  margin: 30px auto 64px;
}
.highlight-word {
  position: relative;
  display: inline-block;
  z-index: 0;
}
.highlight-word::before {
  content: "";
  position: absolute;
  height: 34%;
  width: 108%;
  left: -4%;
  bottom: 5%;
  background: var(--lime);
  z-index: -1;
  transform: rotate(-3deg);
  border-radius: 3px;
}
.highlight-word svg {
  position: absolute;
  width: 100%;
  height: 18px;
  left: 0;
  bottom: -7px;
  fill: none;
  stroke: var(--pink);
  stroke-width: 6;
  stroke-linecap: round;
}
.login-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 430px;
  align-items: center;
  gap: clamp(30px, 6vw, 85px);
  padding: 12px 8px 30px;
}
.login-story {
  position: relative;
  min-width: 0;
}
.login-story h1 {
  font-size: clamp(40px, 4.5vw, 65px);
  line-height: 1.5;
  margin-bottom: 20px;
  letter-spacing: -0.055em;
}
.story-description {
  font-size: 16px;
  margin-bottom: 12px;
  line-height: 1.9;
}
.login-story .highlight-word::before {
  background: transparent;
}
.story-foot {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 11px;
  letter-spacing: 0.025em;
  font-weight: 600;
}
.mini-shapes {
  color: #148780;
  letter-spacing: 4px;
  font-size: 23px;
}
.door-art {
  height: 255px;
  max-width: 480px;
  position: relative;
  margin: 15px 0 24px;
  isolation: isolate;
}
.art-door {
  position: absolute;
  bottom: 14px;
  left: 34%;
  width: 143px;
  height: 214px;
  background: var(--teal);
  border: 2px solid var(--ink);
  border-radius: 72px 72px 0 0;
  box-shadow: 13px 8px 0 var(--ink);
  transform: rotate(7deg);
  z-index: 3;
  animation: door-sway 6s ease-in-out infinite;
}
.door-window {
  position: absolute;
  top: 24px;
  left: 23px;
  width: 94px;
  height: 92px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 45px 45px 5px 5px;
  background-image:
    linear-gradient(
      90deg,
      transparent 48%,
      var(--ink) 49%,
      var(--ink) 51%,
      transparent 52%
    ),
    linear-gradient(
      0deg,
      transparent 48%,
      var(--ink) 49%,
      var(--ink) 51%,
      transparent 52%
    );
}
.door-handle {
  position: absolute;
  width: 13px;
  height: 13px;
  background: var(--yellow);
  border: 2px solid var(--ink);
  border-radius: 50%;
  right: 15px;
  top: 134px;
}
.art-door > span {
  position: absolute;
  bottom: 24px;
  left: 23px;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.1em;
  transform: rotate(-7deg);
}
.art-flower {
  color: var(--pink);
  -webkit-text-stroke: 1.5px var(--ink);
  font-size: 160px;
  line-height: 1;
  position: absolute;
  left: 0;
  top: 33px;
  z-index: 2;
  animation: flower-turn 30s linear infinite;
}
.art-sun {
  width: 100px;
  height: 100px;
  background: var(--yellow);
  border: 2px solid var(--ink);
  border-radius: 50%;
  position: absolute;
  top: 12px;
  right: 7%;
  display: grid;
  place-items: center;
  box-shadow: 5px 5px 0 var(--ink);
  animation: float 4s ease-in-out infinite;
}
.art-sun span {
  font-size: 56px;
}
.art-sticker {
  position: absolute;
  right: 1%;
  bottom: 24px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: var(--lime);
  padding: 16px 20px;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.4;
  transform: rotate(-13deg);
  z-index: 4;
}
.art-floor {
  position: absolute;
  left: 8%;
  bottom: 3px;
  width: 82%;
  height: 18px;
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  border-radius: 50%;
}
.art-orbit {
  position: absolute;
  width: 91%;
  height: 160px;
  left: 5%;
  top: 43px;
  border: 1px dashed #88837b;
  border-radius: 50%;
  transform: rotate(-20deg);
  z-index: -1;
}
.login-card {
  position: relative;
  border: 2px solid var(--ink);
  border-radius: 28px;
  background: var(--paper);
  box-shadow: 8px 8px 0 var(--ink);
  padding: 30px 34px 40px;
  overflow: hidden;
  animation: arrive 0.55s ease both;
}
.card-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  margin-bottom: 20px;
}
.round-badge {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  font-size: 25px;
  background: var(--pink);
  transform: rotate(-12deg);
}
.login-card h2 {
  font-size: 25px;
  letter-spacing: -0.04em;
  margin-bottom: 8px;
}
.login-card .muted {
  font-size: 13px;
}
.login-card form {
  margin-top: 24px;
}
label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 9px;
}
label > span:not(.remember-field span) {
  font-size: 9px;
  font-weight: 600;
  margin-left: 7px;
  color: var(--muted);
}
input,
select {
  border: 1.5px solid var(--ink);
  border-radius: 12px;
  padding: 13px 15px;
  min-height: 49px;
  width: 100%;
  background: #fff;
  color: var(--ink);
}
input::placeholder {
  color: #827f7a;
  font-size: 13px;
}
input:focus,
select:focus {
  background: #fffef7;
}
#username {
  margin-bottom: 19px;
}
.password-field {
  position: relative;
}
.password-field input {
  padding-right: 63px;
}
.password-toggle {
  position: absolute;
  right: 10px;
  top: 7px;
  border: 0;
  background: transparent;
  padding: 8px;
  font-size: 11px;
}
.remember-field {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  margin: 18px 0 23px;
  cursor: pointer;
  font-weight: 500;
}
.remember-field input {
  width: 18px;
  height: 18px;
  min-height: 0;
  margin: 0;
  accent-color: var(--ink);
}
.remember-field span {
  font-size: 12px;
}
.primary,
.secondary {
  border: 1.5px solid var(--ink);
  border-radius: 40px;
  min-height: 47px;
  padding: 12px 21px;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 4px 4px 0 var(--ink);
}
.primary {
  background: var(--pink);
}
#unlockButton {
  color: #ffffff;
}
.secondary {
  background: white;
}
.primary:not(:disabled):hover,
.secondary:not(:disabled):hover,
#logout:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--ink);
}
.primary:not(:disabled):active,
.secondary:not(:disabled):active,
#logout:active {
  transform: translate(3px, 3px);
  box-shadow: 0 0 0 var(--ink);
}
.primary:not(:disabled):hover .button-arrow {
  transform: rotate(45deg);
  background: var(--yellow);
}
.login-submit {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px 10px 23px;
  background: white;
  font-size: 16px;
}
.button-arrow {
  width: 36px;
  height: 36px;
  background: var(--pink);
  border: 1px solid var(--ink);
  border-radius: 50%;
  font-size: 24px;
  display: grid;
  place-items: center;
  transition:
    transform 0.22s,
    background 0.22s;
}
.login-status {
  min-height: 23px;
  margin: 14px 0 0;
  font-size: 12px;
  color: var(--red);
}
.login-note {
  font-size: 11px;
  color: var(--muted);
  padding-top: 16px;
  margin-bottom: 0;
  border-top: 1px dashed #c8c3ba;
}
.color-tabs {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 10px;
  display: flex;
}
.color-tabs i {
  flex: 1;
  background: var(--pink);
}
.color-tabs i:nth-child(2) {
  background: var(--cyan);
}
.color-tabs i:nth-child(3) {
  background: var(--yellow);
}
.color-tabs i:nth-child(4) {
  background: var(--teal);
}
.color-tabs i:nth-child(5) {
  background: var(--lime);
}
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  margin: 16px 0 25px;
}
.page-heading .eyebrow {
  margin-bottom: 12px;
}
.page-heading .muted {
  font-size: 13px;
  margin-bottom: 0;
}
.brand-field {
  min-width: 170px;
}
.workspace-note {
  padding: 12px 19px;
  display: flex;
  align-items: center;
  gap: 13px;
  font-size: 12px;
  margin-bottom: 25px;
  border-top: 1px solid #bbb5ab;
  border-bottom: 1px solid #bbb5ab;
}
.note-icon {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--yellow);
  flex-shrink: 0;
}
.note-flower {
  margin-left: auto;
  font-size: 29px;
  line-height: 1;
  animation: flower-turn 30s linear infinite;
}
.overview {
  display: grid;
  grid-template-columns: repeat(3, 1fr) 1.05fr;
  gap: 18px;
  margin-bottom: 30px;
}
.metric-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  padding: 17px 20px 15px;
  border: 1.5px solid var(--ink);
  border-radius: 17px;
  box-shadow: 4px 4px 0 var(--ink);
}
.metric-pink {
  background: #f8b5cd;
}
.metric-blue {
  background: #a2e9f1;
}
.pin-status-card {
  text-align: left;
  font-family: inherit;
  cursor: pointer;
}
.pin-status-card:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 5px;
}
.pin-status-main {
  grid-column: 1/-1;
  font-size: 26px;
  font-weight: 900;
  line-height: 1.3;
}
.pin-status-card[data-state="complete"] .pin-status-main,
.pin-status-card[data-state="missing"] .pin-status-main {
  font-size: 18px;
}
.pin-status-detail {
  grid-column: 1/-1;
  font-size: 11px;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.pin-status-svg {
  display: block;
  width: 44px;
  height: 44px;
  margin: 4px 0;
}
.pin-status-card[data-state="complete"] .pin-status-svg {
  color: var(--green);
}
.pin-status-card[data-state="failed"] .pin-status-svg {
  color: var(--amber);
}
.pin-status-card[data-state="empty"] .pin-status-svg {
  color: var(--muted);
}
@media (max-width: 760px) {
  .pin-status-detail {
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.4;
  }
}
.today-pin-totals {
  background: #c5ebe8;
  padding: 12px 14px;
  border-radius: 12px;
  margin: 16px 0;
  font-size: 13px;
  font-weight: 700;
}
.today-pin-row-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
#todayPinDialog {
  width: min(720px, calc(100% - 30px));
}
#todayPinRows .badge.neutral {
  background: #ece9e2;
}
.metric-green {
  background: #d2e6a2;
}
.metric-kicker {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  grid-column: 1/-1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3px;
}
.metric-kicker > span {
  font-size: 18px;
  line-height: 1;
}
.metric {
  font-size: 47px;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: -0.06em;
}
.metric + span {
  font-size: 11px;
  margin-left: 7px;
}
.overview-note {
  font-size: 11px;
  color: var(--muted);
  margin: 0;
  align-self: center;
  padding-left: 8px;
  line-height: 2;
}
.overview-note .sync-dot {
  width: 7px;
  height: 7px;
  margin-right: 4px;
}
.overview-note small {
  font-size: 10px;
}
.workspace-grid {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 25px;
  align-items: start;
}
.lock-panel,
.detail-panel {
  min-width: 0;
}
.detail-panel {
  border: 1.5px solid var(--ink);
  border-radius: 22px;
  background: var(--paper);
}
.lock-panel {
  padding: 23px;
}
.detail-panel {
  min-height: 500px;
  padding: 30px;
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.section-heading h2,
.section-heading p {
  margin-bottom: 0;
}
.lock-panel > .section-heading {
  margin-bottom: 19px;
}
.heading-number {
  font-size: 10px;
  margin-left: 8px;
  color: var(--muted);
  font-weight: 500;
}
.text-button {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 20px;
  padding: 8px 9px;
  font-size: 12px;
  font-weight: 700;
  min-height: 39px;
}
.text-button:not(:disabled):hover {
  background: #eee9df;
  border-color: var(--ink);
}
#refreshLocks {
  background: var(--yellow);
  border: 1px solid var(--ink);
  white-space: nowrap;
}
#listStatus {
  min-height: 34px;
  margin: 13px 0 9px;
  font-size: 11px;
}
.lock-list {
  display: grid;
  gap: 11px;
  max-height: 550px;
  overflow: auto;
  padding: 4px 5px 6px 2px;
  scrollbar-width: thin;
}
.lock-item {
  border: 1px solid #bab6ad;
  background: #fff;
  width: 100%;
  display: block;
  text-align: left;
  padding: 16px 14px;
  border-radius: 13px;
}
.lock-item:not(:disabled):hover {
  border-color: var(--ink);
  background: #fff0d2;
  transform: translateY(-2px);
  box-shadow: 3px 3px 0 var(--ink);
}
.lock-item.selected {
  background: #c9ece6;
  border-color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
}
.lock-item strong {
  display: block;
  font-size: 14px;
  font-weight: 800;
}
.lock-room-key {
  color: #999999;
}
.lock-door-role {
  font-size: 16px;
}
.lock-item.passage-on .lock-door-role {
  color: #daa520;
}
.lock-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 10px;
  margin-top: 8px;
  color: var(--muted);
}
.door-icon {
  display: inline-flex;
  width: 23px;
  height: 23px;
  border: 1px solid var(--ink);
  background: #cbe6a4;
  align-items: center;
  justify-content: center;
  margin-right: 9px;
  border-radius: 6px;
  vertical-align: middle;
}
.lock-color-editor {
  margin: 20px 0;
  padding: 16px;
  border: 1px solid #c8c2b8;
  border-radius: 14px;
  background: #faf8f4;
}
.lock-color-editor summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  margin: -16px;
  padding: 10px 16px;
  cursor: pointer;
  list-style: none;
  font-size: 13px;
  font-weight: 700;
  border-radius: 14px;
}
.lock-color-editor summary::-webkit-details-marker {
  display: none;
}
.lock-color-editor summary:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}
.lock-color-editor summary > .symbol-svg {
  transition: transform 160ms ease;
}
.lock-color-editor[open] summary > .symbol-svg {
  transform: rotate(45deg);
}
.color-editor-body {
  padding-top: 28px;
}
.color-editor-heading,
.color-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.color-editor-heading label {
  margin: 0;
  font-size: 13px;
}
.color-editor-heading small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}
.color-controls {
  margin-top: 12px;
}
.color-controls input[type="color"] {
  width: 54px;
  height: 44px;
  min-height: 44px;
  padding: 4px;
  cursor: pointer;
  border-radius: 10px;
}
.color-controls button {
  padding: 8px 12px;
  font-size: 12px;
  min-height: 44px;
}
#lockColorStatus {
  margin: 8px 0 0;
}
.detail-top {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  align-items: flex-start;
}
.detail-top .eyebrow {
  margin-bottom: 13px;
}
.detail-title {
  font-size: 29px;
  margin-bottom: 6px;
  overflow-wrap: anywhere;
}
.badge {
  display: inline-flex;
  border: 1px solid var(--ink);
  border-radius: 30px;
  padding: 5px 10px;
  font-size: 10px;
  background: #d2e6a2;
  white-space: nowrap;
}
.badge.warning {
  background: #ffe6b0;
  color: var(--amber);
}
.badge.error {
  background: #ffd5d9;
  color: var(--red);
}
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin: 25px 0;
}
.status-message {
  padding: 12px 16px;
  border-radius: 12px;
  background: #f1eee6;
  font-size: 12px;
}
.status-message.warning {
  background: #fff0cf;
  color: var(--amber);
}
.content-section {
  margin-top: 25px;
  padding-top: 22px;
  border-top: 1px dashed #bbb6ad;
}
.content-section > .section-heading {
  margin-bottom: 12px;
}
.pin-row,
.history-row {
  padding: 16px 0;
  border-bottom: 1px solid #e5e0d8;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}
.pin-row:last-child,
.history-row:last-child {
  border: 0;
}
.pin-row p,
.history-row p {
  margin-bottom: 4px;
}
.pin-row > div,
.history-row > div {
  min-width: 0;
  overflow-wrap: anywhere;
}
.pin-name {
  font-size: 13px;
}
.record-source-heading {
  margin: 20px 0 10px;
}
.record-source-heading h3 {
  margin: 0;
  font-size: 15px;
}
.cloud-record-heading,
.cloud-record-credential {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.cloud-record-heading {
  font-weight: 700;
}
.source-badge {
  background: #c5ebe8;
  font-size: 10px;
}
.cloud-record-row {
  align-items: flex-start;
}
.cloud-record-success {
  background: #dceca6;
  flex-shrink: 0;
}
.cloud-record-name {
  font-size: 13px;
}
.pin-digits {
  font:
    700 23px ui-monospace,
    monospace;
  letter-spacing: 0.12em;
}
.pin-code-line {
  display: flex;
  align-items: center;
  gap: 10px;
}
.pin-code-line .pin-digits {
  margin-bottom: 0;
}
.pin-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  padding: 8px;
  color: var(--muted);
}
.pin-delete .symbol-svg {
  width: 21px;
  height: 21px;
}
.pin-delete:not(:disabled):hover {
  color: var(--red);
}
#passageSettings.passage-on {
  background: #F0E68C;
}
.pin-tools {
  display: flex;
  gap: 7px;
  flex-shrink: 0;
}
.error-text {
  color: var(--red) !important;
}
.empty-state {
  text-align: center;
  padding: 100px 12px;
  color: var(--muted);
}
.empty-state > span {
  display: block;
  font-size: 77px;
  color: var(--pink);
  -webkit-text-stroke: 1px var(--ink);
  line-height: 1;
  margin-bottom: 26px;
  animation: flower-turn 35s linear infinite;
}
.empty-state h2 {
  font-size: 21px;
  color: var(--ink);
}
.empty-state p {
  font-size: 13px;
}
.boot-status {
  text-align: center;
  color: var(--muted);
  padding: 60px 0;
}
footer {
  max-width: 1280px;
  margin: auto;
  padding: 25px 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid #c8c2b8;
  font-size: 9px;
  letter-spacing: 0.08em;
}
footer strong {
  font-size: 24px;
  letter-spacing: -0.05em;
}
.footer-flower {
  color: #177b74;
  margin-left: 0;
}
.demo-banner {
  padding: 10px 20px;
  font-size: 12px;
  text-align: center;
  background: #ffe5a9;
  border-block: 1px solid var(--ink);
}
dialog {
  width: min(530px, calc(100% - 30px));
  max-height: 90dvh;
  overflow: auto;
  border: 2px solid var(--ink);
  border-radius: 23px;
  box-shadow: 8px 8px 0 var(--ink);
  padding: 28px;
  background: var(--paper);
  color: var(--ink);
}
dialog[open] {
  animation: arrive 0.2s ease-out;
}
dialog::backdrop {
  background: #21212170;
  backdrop-filter: blur(4px);
}
dialog h2 {
  margin: 18px 0 8px;
  font-size: 25px;
}
dialog label {
  margin-top: 17px;
}
.date-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}
.notice {
  padding: 15px;
  font-size: 13px;
  background: #fff0cb;
  border-radius: 12px;
  margin-top: 23px;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 13px;
  margin-top: 26px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
@keyframes flower-turn {
  to {
    transform: rotate(360deg);
  }
}
@keyframes float {
  50% {
    transform: translateY(-9px) rotate(6deg);
  }
}
@keyframes door-sway {
  50% {
    transform: rotate(3deg) translateY(-3px);
  }
}
@keyframes arrive {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes button-pop {
  40% {
    scale: 0.96;
  }
  75% {
    scale: 1.015;
  }
  100% {
    scale: 1;
  }
}
@keyframes form-shake {
  25%,
  75% {
    translate: -3px;
  }
  50% {
    translate: 3px;
  }
}
.button-pop {
  animation: button-pop 0.3s ease-out;
}
.form-error {
  animation: form-shake 0.22s ease;
}
.motion-paused *,
.motion-paused *::before,
.motion-paused *::after {
  animation: none !important;
  transition: none !important;
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
@media (max-width: 1000px) {
  .wordmark .wordmark-sub {
    display: none;
  }
  .login-panel {
    grid-template-columns: minmax(0, 1fr) 385px;
    gap: 30px;
  }
  .login-card {
    padding: 25px 26px 36px;
  }
  .login-story h1 {
    font-size: 44px;
  }
  .door-art {
    scale: 0.9;
    transform-origin: left center;
  }
  .workspace-grid {
    grid-template-columns: 290px minmax(0, 1fr);
    gap: 18px;
  }
  .overview {
    gap: 14px;
    grid-template-columns: repeat(3, 1fr);
  }
  .overview-note {
    grid-column: 1/-1;
    padding: 0;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
  }
  .overview-note br {
    display: none;
  }
  .metric-card {
    padding: 15px;
  }
  .detail-panel {
    padding: 22px;
  }
}
@media (max-width: 760px) {
  .topbar {
    padding: 19px 22px;
    min-height: 82px;
  }
  .wordmark {
    font-size: 28px;
  }
  .brand-symbol {
    font-size: 35px;
  }
  .identity {
    gap: 10px;
    font-size: 10px;
  }
  #identity {
    display: none;
  }
  #logout {
    padding: 8px 14px;
  }
  .motion-toggle {
    font-size: 10px;
  }
  main {
    padding: 0 22px;
    margin: 20px auto 40px;
  }
  .login-panel {
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 0;
    max-width: 500px;
    margin: auto;
  }
  .login-story {
    padding-top: 5px;
  }
  .login-story h1 {
    font-size: clamp(35px, 8vw, 48px);
    margin-bottom: 14px;
  }
  .login-story .eyebrow {
    margin-bottom: 15px;
  }
  .story-description {
    font-size: 13px;
  }
  .door-art {
    position: absolute;
    width: 170px;
    height: 120px;
    right: -6px;
    bottom: 6px;
    scale: 0.46;
    transform-origin: bottom right;
    pointer-events: none;
  }
  .art-flower {
    left: -230px;
    top: -70px;
  }
  .art-door {
    left: -70px;
    bottom: 0;
  }
  .art-sun {
    right: -2%;
    top: -120px;
  }
  .art-sticker,
  .art-floor,
  .art-orbit {
    display: none;
  }
  .story-foot {
    font-size: 9px;
    margin-top: 25px;
  }
  .mini-shapes {
    font-size: 19px;
  }
  .login-card {
    margin-right: 7px;
    padding: 25px 27px 37px;
  }
  .login-card h2 {
    font-size: 25px;
  }
  .page-heading {
    margin-top: 15px;
  }
  .page-heading h1 {
    font-size: clamp(28px, 5.8vw, 40px);
  }
  .page-heading .muted {
    font-size: 12px;
  }
  .page-heading .eyebrow {
    font-size: 9px;
  }
  .workspace-note {
    padding: 11px 4px;
    font-size: 11px;
    gap: 9px;
  }
  .note-flower {
    font-size: 23px;
  }
  .overview {
    gap: 10px;
    margin-bottom: 23px;
  }
  .metric-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
    padding: 13px 11px;
    border-radius: 13px;
    box-shadow: 3px 3px 0 var(--ink);
  }
  .metric-kicker {
    font-size: 7px;
    letter-spacing: 0;
    width: 100%;
  }
  .metric-kicker > span {
    font-size: 13px;
  }
  .metric {
    font-size: 36px;
  }
  .metric + span {
    font-size: 10px;
    margin: 0;
  }
  .overview-note {
    font-size: 10px;
  }
  .overview-note small {
    display: none;
  }
  .workspace-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .lock-panel {
    padding: 20px;
  }
  .lock-list {
    grid-template-columns: 1fr 1fr;
    max-height: 320px;
    gap: 10px;
  }
  .lock-item {
    padding: 13px 10px;
  }
  .lock-item strong {
    font-size: 12px;
  }
  .lock-door-role {
    font-size: 14px;
  }
  .door-icon {
    width: 19px;
    height: 19px;
    margin-right: 5px;
  }
  .lock-meta {
    font-size: 9px;
    gap: 5px;
    flex-wrap: wrap;
  }
  .detail-panel {
    min-height: 300px;
    padding: 22px;
  }
  .empty-state {
    padding: 45px 10px;
  }
  .empty-state > span {
    font-size: 62px;
  }
  .detail-title {
    font-size: 24px;
  }
  .pin-tools {
    flex-direction: column;
    gap: 3px;
  }
  .pin-row {
    align-items: flex-start;
  }
  .date-fields {
    grid-template-columns: 1fr;
  }
  .detail-actions {
    gap: 12px;
  }
  .detail-actions button {
    font-size: 12px;
    padding: 11px 15px;
  }
  footer {
    padding: 21px 22px;
    gap: 8px;
  }
  footer > span {
    font-size: 7px;
  }
  footer small {
    display: none;
  }
}
@media (max-width: 370px) {
  main {
    padding: 0 16px;
  }
  .login-card {
    padding: 23px 22px 35px;
  }
  .login-story h1 {
    font-size: 35px;
  }
  .door-art {
    scale: 0.38;
  }
  .story-foot {
    font-size: 8px;
  }
  .metric-kicker > span {
    display: none;
  }
  .lock-list {
    grid-template-columns: 1fr;
  }
}

.lock-tools {
  display: flex;
  align-items: center;
  gap: 6px;
}
#sortLocks {
  border: 1px solid var(--ink);
  background: white;
}
.lock-row {
  position: relative;
  min-width: 0;
}
.lock-row > .lock-item {
  height: 100%;
}
.sort-controls {
  margin: 12px 0;
  border: 1px dashed var(--ink);
  border-radius: 12px;
  background: #fff0d2;
  padding: 13px;
}
.sort-controls p {
  font-size: 12px;
  margin: 0 0 12px;
}
.sort-controls > div {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sort-controls button {
  font-size: 12px;
  padding: 10px 14px;
}
#sortStatus:empty {
  display: none;
}
.lock-list.sorting {
  grid-template-columns: 1fr;
  max-height: 65vh;
}
.sorting .lock-item {
  padding-right: 62px;
  opacity: 1;
  cursor: default;
}
.sort-handle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  padding: 9px;
  border: 1px solid #bbb5ab;
  border-radius: 10px;
  background: #f2efeb;
  color: var(--ink);
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.sort-handle:active {
  cursor: grabbing;
}
.sort-handle .symbol-svg {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.sort-ghost {
  opacity: 0.3;
}
.sort-chosen > .lock-item {
  border-color: var(--ink);
  background: #fff0d2;
}
.sort-floating {
  opacity: 0.95 !important;
  box-shadow: 5px 5px 0 var(--ink);
  border-radius: 13px;
}
.sort-floating .lock-item {
  padding-right: 62px;
}

footer strong {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}
@media (max-width: 370px) {
  .wordmark {
    font-size: 22px;
    gap: 7px;
  }
  .wordmark .brand-symbol {
    font-size: 32px;
  }
  .identity {
    gap: 7px;
  }
  .topbar {
    gap: 8px;
  }
  footer strong {
    font-size: 20px;
  }
}

.selection-toggle {
  white-space: nowrap;
}
#selectLocks {
  border: 1px solid var(--ink);
  background: white;
}
#selectLocks[aria-pressed="true"] {
  background: #e7f2cc;
}
.lock-panel > .section-heading {
  flex-wrap: wrap;
}
.lock-tools .text-button {
  min-height: 44px;
}
.detail-stack {
  display: grid;
  gap: 20px;
  min-width: 0;
}
.detail-panel {
  scroll-margin-top: 20px;
}
.record-disclosure > summary {
  cursor: pointer;
  min-height: 44px;
  padding: 12px 0;
  font-weight: 700;
}
.record-disclosure > summary:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 4px;
}
.record-disclosure > .section-heading {
  justify-content: flex-end;
}
.record-disclosure > .record-source-heading {
  justify-content: space-between;
}
.load-more {
  margin-top: 12px;
  min-height: 44px;
  border-color: var(--ink);
}
.selection-controls {
  padding: 14px;
  margin-bottom: 16px;
  border-radius: 14px;
  background: #e7f2cc;
}
.selection-controls p {
  margin-bottom: 6px;
  font-weight: 700;
}
.selection-controls > div {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.selection-controls button {
  padding: 9px 10px;
  font-size: 12px;
}
.selection-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 1px solid currentColor;
  border-radius: 4px;
  margin-right: 6px;
  vertical-align: middle;
}
#batchFields {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
#batchDialog {
  width: min(680px, calc(100vw - 24px));
}
.batch-review {
  margin: 16px 0;
}
.batch-review article {
  padding: 12px 0;
  border-top: 1px dashed #c8c2b8;
  overflow-wrap: anywhere;
}
.batch-review p {
  margin-bottom: 5px;
}
.batch-review .badge {
  margin-left: 6px;
}
@media (max-width: 500px) {
  #batchDialog .dialog-actions {
    flex-wrap: wrap;
  }
}
/* Keep confirmation reachable while reviewing a long list on a phone. */
dialog .dialog-actions {
  position: sticky;
  bottom: -28px;
  padding: 12px 0;
  background: var(--paper);
  z-index: 1;
}
#editTimeError:empty {
  display: none;
}

.workspace-grid.selecting {
  grid-template-columns: 1fr;
}
.workspace-grid.selecting .lock-list {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  max-height: 560px;
}

#feedbackDialog {
  text-align: center;
  width: min(420px, calc(100vw - 30px));
}
.feedback-symbol {
  width: 64px;
  height: 64px;
  color: #177b74;
  margin-top: 6px;
}
#feedbackDialog[data-state="failed"] .feedback-symbol,
#feedbackDialog[data-state="uncertain"] .feedback-symbol {
  color: var(--amber);
}
#feedbackMessage {
  color: var(--muted);
  overflow-wrap: anywhere;
}
#closeFeedback {
  margin-top: 10px;
}
.progress-spinner {
  animation: progress-turn 1.8s linear infinite;
}
.progress-banner {
  position: sticky;
  top: -28px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--ink);
  border-radius: 14px;
  background: #e7f2cc;
  font-weight: 700;
}
.progress-banner .symbol-svg {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
}
@keyframes progress-turn {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .progress-spinner {
    animation: none;
  }
}
.motion-paused .progress-spinner {
  animation: none;
}

.pin-engine-panel {
  margin: 0;
  background: transparent;
  padding: 16px 0;
  border: 0;
  border-radius: 0;
}
.pin-engine-panel > .secondary {
  width: fit-content;
  max-width: 100%;
  border-radius: 999px;
  padding: 13px 24px;
}
.pin-engine-panel .fine {
  margin: 10px 0;
}
#pinEngineDialog {
  width: min(720px, calc(100% - 32px));
  max-height: 85dvh;
  overflow: auto;
}
#pinEngineDialog h2 {
  padding-right: 12px;
}
#pinEngineDialog[data-pending="true"] #pinEngineProgress::before {
  content: "◌ ";
  display: inline-block;
  animation: spin 1.5s linear infinite;
}
.pin-engine-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 22px;
}
.pin-engine-item {
  border-top: 1px solid var(--line, #dadcd3);
  padding: 14px 0;
  overflow-wrap: anywhere;
}
.pin-engine-item p {
  margin: 5px 0;
}
.pin-engine-item .badge {
  display: inline-block;
  margin-left: 8px;
}
@media (prefers-reduced-motion: reduce) {
  #pinEngineDialog[data-pending="true"] #pinEngineProgress::before {
    animation: none;
  }
}

.replacement-banner {
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  right: 1rem;
  z-index: 30;
  max-width: 850px;
  margin: auto;
  background: var(--yellow, #f4d477);
  border: 2px solid #222;
  border-radius: 20px;
  padding: 1rem;
  box-shadow: 4px 4px 0 #222;
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}
.replacement-banner[hidden] {
  display: none;
}
.replacement-review {
  margin-top: 1.5rem;
  border-top: 1px dashed #777;
  padding-top: 1rem;
}
.replacement-ack {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}
.replacement-ack input {
  width: 1.2rem;
  height: 1.2rem;
  flex-shrink: 0;
}
#replacementSteps {
  padding-left: 1.5rem;
  line-height: 1.9;
}
#replacementReceipt {
  overflow-wrap: anywhere;
}
#replacementInput,
#replacementCandidate {
  width: 100%;
}
.replacement-history {
  display: block;
  margin-top: 0.5rem;
  overflow-wrap: anywhere;
  text-align: left;
}
@media (max-width: 600px) {
  .replacement-banner {
    flex-direction: column;
    align-items: stretch;
  }
  .replacement-banner p {
    margin: 0;
  }
}

/* Sparse status icons: only a positively confirmed state is shown. */
.lock-status-icons,
.detail-indicators,
.detail-tools {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.lock-status-icons .symbol-svg,
.detail-indicators .symbol-svg {
  width: 20px;
  height: 20px;
}
.status-icon {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.detail-tools {
  align-items: flex-start;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.detail-indicators {
  padding-top: 8px;
  white-space: nowrap;
}
.lock-settings-menu {
  position: relative;
}
.lock-settings-menu > summary {
  list-style: none;
  cursor: pointer;
  padding: 7px;
  border: 0;
  border-radius: 0;
  background: transparent;
  display: flex;
}
.lock-settings-menu > summary::-webkit-details-marker {
  display: none;
}
.lock-settings-menu .settings-menu-items {
  position: absolute;
  right: 0;
  top: 44px;
  z-index: 20;
  width: 220px;
  background: var(--paper, #fff);
  border: 1px solid var(--border, #ddd);
  border-radius: 12px;
  box-shadow: 0 6px 24px #0002;
  padding: 10px;
}
.settings-menu-items button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px;
  border: 0;
  border-radius: 6px;
}
.settings-menu-items .fine {
  padding: 8px;
  margin: 0;
}
.settings-fields {
  border: 0;
  padding: 0;
  display: grid;
  gap: 16px;
  min-width: 0;
}
.settings-fields > label {
  display: grid;
  gap: 8px;
}
.settings-fields .settings-check,
.settings-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 12px 0;
}
.settings-check input,
.settings-days input {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin: 2px 0;
}
.settings-days {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  border: 1px solid #ddd;
  border-radius: 10px;
}
.settings-days label {
  display: flex;
  gap: 5px;
  align-items: center;
}
.settings-times {
  display: flex;
  gap: 16px;
}
.settings-times[hidden] {
  display: none;
}
.settings-times label {
  flex: 1;
  min-width: 0;
}
.settings-fields p {
  font-size: 13px;
  color: var(--muted, #555);
  line-height: 1.6;
  margin: 0;
}
#updateResults .secondary {
  display: block;
  margin-top: 8px;
}
.update-result {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
}
.update-result-version {
  flex-basis: 100%;
  margin: 0;
}
.update-result-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.update-result-status.has-update {
  color: #287a47;
}
#updatesDialog {
  max-width: 650px;
}
#updatesDialog .dialog-actions {
  flex-wrap: wrap;
}
@media (max-width: 700px) {
  .detail-top {
    gap: 12px;
  }
  .detail-tools {
    gap: 8px;
  }
  .detail-indicators {
    gap: 8px;
    font-size: 13px;
  }
  .settings-times {
    flex-wrap: wrap;
  }
  .lock-meta {
    align-items: center;
  }
  .detail-top > div:first-child {
    min-width: 0;
  }
}

#lowestBatteryLock {
  overflow-wrap: anywhere;
  max-width: 100%;
  line-height: 1.5;
  text-align: right;
}
@media (max-width: 700px) {
  .detail-top {
    position: relative;
    display: block;
  }
  .detail-tools {
    position: absolute;
    right: 0;
    top: -8px;
    flex-wrap: nowrap;
    align-items: center;
  }
  .detail-top .detail-title {
    padding-top: 26px;
  }
  #lowestBatteryLock {
    max-width: 100%;
    text-align: left;
  }
}

.lock-settings-menu > summary:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

.lock-settings-menu > summary .symbol-svg {
  width: 20px;
  height: 20px;
}

.wordmark .brand-app-icon { width: 64px; height: 64px; object-fit: contain; flex: none; mix-blend-mode: multiply; }
@media (max-width: 600px) { .wordmark .brand-app-icon { width: 44px; height: 44px; } }
.remember-field input[type="checkbox"] { appearance:none; -webkit-appearance:none; flex:0 0 24px; width:24px; height:24px; min-height:24px; padding:0; margin:0; border:1px solid var(--line, #d8d5ce); border-radius:50%; background:#fff; display:grid; place-content:center; cursor:pointer; box-sizing:border-box; min-width:24px; max-width:24px; max-height:24px; aspect-ratio:1 / 1; align-self:center; box-shadow:none; }
.remember-field input[type="checkbox"]:checked { background:var(--ink, #242424); border-color:var(--ink, #242424); background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m3 8 3 3 7-7' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-position:center; background-repeat:no-repeat; background-size:16px 16px; box-shadow:none; }
.remember-field input[type="checkbox"]:checked::after { content:none; }
.remember-field input[type="checkbox"]:focus-visible { outline:2px solid var(--ink, #242424); outline-offset:4px; }
