.login-card {
  width: min(400px, calc(100% - 40px));
  margin: 10vh auto;
  padding: 32px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 10px 30px #11182708;
}
.login-card .eyebrow {
  margin-top: 16px;
}
.login-card h1 {
  font-size: 26px;
}
.login-card form .primary {
  margin-top: 24px;
  width: 100%;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 16px;
  width: min(620px, calc(100% - 24px));
  max-height: 88dvh;
  padding: 24px;
  box-shadow: 0 20px 90px #17203330;
  color: var(--text);
}
dialog::backdrop {
  background: #19223355;
  backdrop-filter: blur(3px);
}
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}
.dialog-head button {
  border: 0;
  font-size: 25px;
  min-width: 36px;
  padding: 0;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 22px;
}

/* Unified App Confirm Dialog */
.app-confirm-dialog {
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: transparent;
  width: min(340px, calc(100vw - 40px));
  max-width: 360px;
  box-shadow: 0 16px 48px rgba(15, 56, 46, 0.22);
  overflow: hidden;
}
.app-confirm-dialog::backdrop {
  background: rgba(15, 38, 30, 0.45);
  backdrop-filter: blur(4px);
}
.confirm-card {
  background: #fff;
  padding: 24px 20px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.confirm-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #eef6f1;
  color: #285d45;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
}
.confirm-card.is-danger .confirm-icon-wrap {
  background: #fdf2f0;
  color: #c24136;
}
.confirm-icon-wrap .ui-icon {
  width: 26px;
  height: 26px;
}
.confirm-title {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 700;
  color: #17382e;
}
.confirm-message {
  margin: 0 0 20px;
  font-size: 14px;
  line-height: 1.6;
  color: #5c6f65;
  word-break: break-word;
}
.confirm-actions {
  display: flex;
  gap: 10px;
  width: 100%;
}
.confirm-btn {
  flex: 1;
  min-height: 44px;
  height: 44px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  border: 0;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: opacity .15s;
}
.confirm-cancel {
  background: #f0f4f1;
  color: #52675b;
}
.confirm-ok.primary {
  background: #285d45;
  color: #fff;
  box-shadow: 0 2px 8px rgba(40, 93, 69, 0.25);
}
.confirm-ok.danger {
  background: #c24136;
  color: #fff;
  box-shadow: 0 2px 8px rgba(194, 65, 54, 0.25);
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 14px;
}
fieldset {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 12px;
  margin: 18px 0;
}
legend {
  font-size: 12px;
  color: var(--muted);
  padding: 0 6px;
}
.weekday-checks {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.weekday-checks label {
  display: flex;
  gap: 4px;
  align-items: center;
}
.weekday-checks input {
  width: 16px;
  min-height: 16px;
  margin: 0;
}
.detail-date {
  color: var(--primary);
  font-weight: 600;
}
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  color: var(--muted);
  font-size: 12px;
}
.notes {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.step-progress {
  margin-top: 24px;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}
.step-progress strong {
  color: var(--primary);
}
.step-tabs {
  display: flex;
  gap: 6px;
  overflow: auto;
  margin: 14px 0;
}
.step-tabs .active {
  background: #ede7f8;
  color: var(--primary);
  border-color: #b6a4da;
}
.step-card {
  background: #fafbfc;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
}
.step-card img {
  display: block;
  max-width: 100%;
  max-height: 340px;
  object-fit: contain;
  border-radius: 6px;
  margin: 16px auto;
}
.step-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.danger-zone {
  border-top: 1px solid var(--line);
  margin-top: 20px;
  padding-top: 16px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.danger-zone select {
  width: auto;
}
[hidden] {
  display: none !important;
}

.dialog-head h2 {
  min-width: 0;
  overflow-wrap: anywhere;
}

#image-source-picker {
  box-sizing: border-box;
  inset: auto 0 0;
  margin: 0 auto;
  width: min(460px, 100%);
  padding: 16px 16px calc(12px + env(safe-area-inset-bottom));
  border-radius: 18px 18px 0 0;
  background: #fff;
  text-align: center;
}
#image-source-picker h3 { margin: 0 0 12px; font-size: 16px; }
#image-source-picker button {
  display: block;
  width: 100%;
  min-height: 48px;
  margin-top: 6px;
  background: #f2f6f3;
  color: #17382e;
  border: 0;
  border-radius: 10px;
}
#image-source-picker [data-source="cancel"] { background: #fff; color: #5b6962; }
