*, *::before, *::after {
  box-sizing: border-box;
}

:root {
  --bg-page: #f1f5f9;
  --bg-card: #ffffff;
  --text-main: #1e293b;
  --text-strong: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --border-soft: #e2e8f0;
  --indigo: #4f46e5;
  --indigo-dark: #4338ca;
  --rose: #f43f5e;
  --emerald: #10b981;
  --amber: #f59e0b;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  -webkit-tap-highlight-color: transparent;
}

button, input, textarea {
  font-family: inherit;
}

.hidden {
  display: none !important;
}

.cursor-pointer {
  cursor: pointer;
}

.text-center {
  text-align: center;
}

.uppercase {
  text-transform: uppercase;
}

.lowercase {
  text-transform: lowercase;
}

.px-1 {
  padding-left: 4px;
  padding-right: 4px;
}

/* Icons */
.icon-xs svg { width: 14px; height: 14px; display: block; }
.icon-sm svg { width: 16px; height: 16px; display: block; }
.icon-md svg { width: 20px; height: 20px; display: block; }
.icon-lg svg { width: 24px; height: 24px; display: block; }

.text-indigo { color: var(--indigo); }
.text-emerald { color: #34d399; }
.text-rose { color: #e11d48 !important; }

/* App Shell */
.app-shell {
  width: 100%;
  max-width: 448px;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

@media (min-width: 640px) {
  body {
    padding: 24px 0;
  }
  .app-shell {
    min-height: 820px;
    border-radius: 36px;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.22);
    border: 1px solid rgba(226, 232, 240, 0.85);
  }
}

/* Header */
.app-header {
  padding: calc(16px + env(safe-area-inset-top, 0px)) 20px 14px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid #f1f5f9;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 14px;
  background: linear-gradient(45deg, #f43f5e, #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.25);
  flex-shrink: 0;
}

.brand-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.brand-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-strong);
  line-height: 1.2;
}

.room-pill {
  border: 1px solid #e0e7ff;
  background: #eef2ff;
  color: #4338ca;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  cursor: pointer;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sync-status {
  margin: 2px 0 0;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  display: inline-block;
  flex-shrink: 0;
}

.dot-emerald { background: #10b981; animation: pulse 2s infinite; }
.dot-amber { background: #f59e0b; }
.dot-rose { background: #f43f5e; }
.dot-slate { background: #94a3b8; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  border: none;
  background: transparent;
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}

.icon-btn:hover {
  background: #f1f5f9;
  color: var(--text-main);
}

.icon-btn.danger:hover {
  background: #fff1f2;
  color: #e11d48;
}

.spin svg {
  animation: spin 0.8s linear infinite;
}

/* Main */
.app-main {
  flex: 1;
  padding: 16px 20px calc(88px + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-label {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-light);
}

/* Banners */
.setup-banner {
  border-radius: 20px;
  padding: 12px 14px;
  background: linear-gradient(135deg, #eef2ff, #fff1f2);
  border: 1px solid #c7d2fe;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.setup-banner-title {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: #312e81;
}

.setup-banner-sub {
  margin: 2px 0 0;
  font-size: 11px;
  color: #475569;
  line-height: 1.4;
}

.ios-banner {
  border-radius: 16px;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ios-banner-text {
  margin: 0;
  font-size: 11px;
  color: #475569;
  line-height: 1.4;
}

.ios-close-btn {
  border: none;
  background: #e2e8f0;
  color: #475569;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

/* Summary Card */
.summary-card {
  border-radius: 24px;
  padding: 16px;
  background: linear-gradient(135deg, #eef2ff 0%, #ffffff 50%, #fff1f2 100%);
  border: 1px solid rgba(199, 210, 254, 0.8);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

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

.summary-kicker {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.summary-today-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.summary-today-label {
  font-size: 12px;
  font-weight: 700;
  color: #334155;
}

.summary-emoji-box {
  width: 40px;
  height: 40px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid #f1f5f9;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.summary-off-bar {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(224, 231, 255, 0.85);
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.summary-off-bar::-webkit-scrollbar {
  display: none;
}

.summary-off-label {
  font-size: 11px;
  font-weight: 700;
  color: #047857;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.summary-off-chips {
  display: flex;
  align-items: center;
  gap: 6px;
}

.off-chip {
  padding: 2px 8px;
  border-radius: 8px;
  background: #fff;
  color: #047857;
  border: 1px solid #a7f3d0;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.badge-pill {
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.badge-none { background: #e2e8f0; color: #475569; }
.badge-off { background: #10b981; color: #fff; font-weight: 800; }
.badge-work { background: #4f46e5; color: #fff; font-weight: 800; }

/* Upload Dropzone & Scanning */
.upload-dropzone {
  display: block;
  cursor: pointer;
  border-radius: 24px;
  border: 2px dashed var(--border-soft);
  background: rgba(248, 250, 252, 0.75);
  padding: 16px;
  transition: border-color 0.2s, background-color 0.2s;
}

.upload-dropzone:hover {
  border-color: #818cf8;
  background: rgba(238, 242, 255, 0.35);
}

.upload-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.upload-icon-box {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid #f1f5f9;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--indigo);
  flex-shrink: 0;
}

.upload-copy {
  flex: 1;
  min-width: 0;
}

.upload-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}

.upload-desc {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
}

.scanning-box {
  border-radius: 24px;
  background: var(--text-strong);
  color: #fff;
  padding: 16px;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.3);
  position: relative;
  overflow: hidden;
}

.scanning-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.scan-thumb-wrap {
  width: 56px;
  height: 64px;
  border-radius: 12px;
  background: #1e293b;
  border: 1px solid #334155;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scan-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
}

.scan-laser {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: #34d399;
  box-shadow: 0 0 8px #34d399;
}

.scan-info {
  flex: 1;
  min-width: 0;
}

.scan-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.scan-ping {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #34d399;
  animation: pulse 1.2s infinite;
}

.scan-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}

.scan-subtitle {
  margin: 4px 0 0;
  font-size: 12px;
  color: #cbd5e1;
}

/* AI Preview Box */
.ai-preview-box {
  border-radius: 24px;
  border: 1px solid #c7d2fe;
  background: #f8fafc;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ai-preview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.ai-preview-kicker {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  color: var(--indigo);
  text-transform: uppercase;
}

.ai-preview-title {
  margin: 2px 0 0;
  font-size: 14px;
  font-weight: 800;
  color: var(--text-strong);
}

.ai-preview-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-height: 110px;
  overflow-y: auto;
}

.ai-chip {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #e2e8f0;
  color: #334155;
}

.ai-preview-actions {
  display: flex;
  gap: 8px;
}

.ai-preview-actions > button {
  flex: 1;
}

/* Calendar Card */
.calendar-card {
  border-radius: 24px;
  background: #fff;
  border: 1px solid rgba(226, 232, 240, 0.9);
  padding: 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.month-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.circle-nav-btn {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: none;
  background: #f1f5f9;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.15s;
}

.circle-nav-btn:hover {
  background: #e2e8f0;
}

.month-title {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  color: var(--text-strong);
  min-width: 108px;
  text-align: center;
}

.today-pill {
  border: 1px solid #c7d2fe;
  background: #eef2ff;
  color: var(--indigo);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
  cursor: pointer;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-pill {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--border-soft);
  background: #fff;
  color: #475569;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.filter-pill.active-off {
  background: #059669;
  border-color: #059669;
  color: #fff;
  font-weight: 700;
}

.filter-pill.active-note {
  background: #f43f5e;
  border-color: #f43f5e;
  color: #fff;
  font-weight: 700;
}

.stats-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  background: #f8fafc;
  padding: 8px 12px;
  border-radius: 16px;
}

.weekday-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  padding-top: 2px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-light);
}

.weekday-row .weekend {
  color: #f43f5e;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px 4px;
}

.cal-empty {
  height: 68px;
}

.cal-cell {
  height: 68px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 4px 2px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  position: relative;
  transition: transform 0.15s, opacity 0.15s, background-color 0.15s, border-color 0.15s;
}

.cal-cell:hover {
  border-color: var(--border-soft);
  background: #f8fafc;
}

.cal-cell.is-off-bg {
  background: rgba(236, 253, 245, 0.7);
}

.cal-cell.has-note {
  border-color: #fda4af;
  box-shadow: 0 0 0 2px rgba(251, 113, 133, 0.45);
  background: linear-gradient(to bottom, rgba(255, 241, 242, 0.9), #ffffff, rgba(255, 251, 235, 0.6));
}

.cal-cell.is-today {
  border-color: #0f172a;
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.15);
  background: #ffffff;
}

.cal-cell.is-today.has-note {
  box-shadow: 0 0 0 2px rgba(251, 113, 133, 0.6), 0 0 0 4px rgba(15, 23, 42, 0.85);
}

.cal-cell.dimmed {
  opacity: 0.25;
  transform: scale(0.95);
}

.cal-cell.focused {
  transform: scale(1.08);
  z-index: 10;
}

.cal-day-head {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 100%;
}

.cal-day-num {
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  color: #334155;
}

.cal-day-num.weekend { color: #f43f5e; }
.cal-day-num.note-day { color: #be123c; font-weight: 800; }
.cal-day-num.today-num {
  width: 17px;
  height: 17px;
  border-radius: 999px;
  background: #0f172a;
  color: #fff;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cal-heart {
  position: absolute;
  right: 2px;
  top: -2px;
  font-size: 10px;
  line-height: 1;
}

.shift-badge {
  width: 100%;
  max-width: 42px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 4px;
  border-radius: 999px;
  line-height: 1.2;
}

.shift-off { background: #d1fae5; color: #047857; border: 1px solid #a7f3d0; }
.shift-b { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.shift-c { background: #e0e7ff; color: #4338ca; border: 1px solid #c7d2fe; }
.shift-other { background: #f3e8ff; color: #7e22ce; border: 1px solid #e9d5ff; }

.note-pill-mini {
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  font-size: 8.5px;
  font-weight: 700;
  padding: 2px 4px;
  border-radius: 6px;
  background: #f43f5e;
  color: #fff;
  line-height: 1;
}

.shift-spacer { height: 14px; }
.note-spacer { height: 12px; }

/* Legend */
.legend-row {
  padding-top: 8px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
}

.legend-items {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  display: inline-block;
}

.bg-emerald { background: #10b981; }
.bg-indigo { background: #6366f1; }
.bg-amber { background: #f59e0b; }
.bg-rose { background: #f43f5e; }
.legend-hint { color: var(--text-light); font-style: italic; }

/* Notes List */
.notes-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notes-empty {
  border-radius: 16px;
  border: 1px dashed var(--border-soft);
  padding: 16px;
  text-align: center;
  font-size: 12px;
  color: var(--text-light);
}

.note-card {
  cursor: pointer;
  border-radius: 16px;
  background: linear-gradient(to right, rgba(255, 241, 242, 0.65), #ffffff);
  border: 1px solid rgba(254, 205, 211, 0.85);
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: border-color 0.15s;
}

.note-card:hover {
  border-color: #fb7185;
}

.note-card-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.note-date-badge {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #f43f5e;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.note-date-month {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  opacity: 0.9;
}

.note-date-day {
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
}

.note-text-wrap {
  min-width: 0;
}

.note-title {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.note-sub {
  margin: 2px 0 0;
  font-size: 11px;
  color: var(--text-muted);
}

.note-edit-btn {
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  background: #fff;
  border: 1px solid var(--border-soft);
  color: #475569;
  cursor: pointer;
  flex-shrink: 0;
}

/* Toast */
.toast {
  position: fixed;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.95);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  padding: 10px 16px;
  border-radius: 999px;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  max-width: calc(100vw - 32px);
}

.toast.visible {
  opacity: 1;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 40;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

@media (min-width: 640px) {
  .modal-backdrop {
    align-items: center;
  }
}

.modal-sheet {
  background: #fff;
  width: 100%;
  max-width: 448px;
  border-radius: 24px 24px 0 0;
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.35);
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 90dvh;
  overflow-y: auto;
}

@media (min-width: 640px) {
  .modal-sheet {
    border-radius: 24px;
    padding: 20px;
  }
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-kicker {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--indigo);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.modal-title {
  margin: 2px 0 0;
  font-size: 18px;
  font-weight: 800;
  color: var(--text-strong);
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

.field-label-row {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.field-hint-rose {
  font-size: 11px;
  font-weight: 400;
  color: var(--rose);
}

.shift-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.shift-chip {
  padding: 10px 4px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--border-soft);
  background: #fff;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s;
}

.shift-chip.active {
  border: 2px solid var(--indigo);
  background: #eef2ff;
  color: var(--indigo-dark);
  font-weight: 800;
  transform: scale(1.04);
}

.custom-shift-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.text-input, .textarea-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid var(--border-soft);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-strong);
  outline: none;
}

.text-input:focus, .textarea-input:focus {
  border-color: var(--indigo);
}

.textarea-input {
  font-weight: 400;
  font-size: 14px;
  resize: none;
  border-radius: 16px;
}

.readonly-input {
  font-size: 11px;
  color: #475569;
}

.clear-shift-btn {
  padding: 10px 12px;
  border-radius: 12px;
  border: none;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
}

.clear-shift-btn:hover {
  background: #f1f5f9;
}

.quick-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-btn {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.tag-rose { background: #fff1f2; color: #e11d48; border: 1px solid #fecdd3; }
.tag-amber { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.tag-indigo { background: #eef2ff; color: #4f46e5; border: 1px solid #c7d2fe; }
.tag-emerald { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }

.helper-text {
  margin: 0;
  font-size: 11px;
  color: var(--text-light);
}

.invite-box, .backup-box {
  padding: 12px;
  border-radius: 16px;
  background: #f8fafc;
  border: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.backup-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.confirm-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: #475569;
}

.modal-actions {
  display: flex;
  gap: 10px;
  padding-top: 4px;
}

.modal-actions > button {
  flex: 1;
}

.btn-primary {
  padding: 12px;
  border-radius: 16px;
  border: none;
  background: var(--indigo);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 15px rgba(79, 70, 229, 0.25);
}

.btn-primary:hover { background: var(--indigo-dark); }

.btn-secondary {
  padding: 12px;
  border-radius: 16px;
  border: none;
  background: #f1f5f9;
  color: #475569;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.btn-danger {
  padding: 12px;
  border-radius: 16px;
  border: none;
  background: #e11d48;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.btn-primary-sm {
  padding: 9px 14px;
  border-radius: 12px;
  border: none;
  background: var(--indigo);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.btn-secondary-sm {
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  background: #fff;
  color: #475569;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

@keyframes scanline {
  0% { top: 0%; opacity: 0.9; }
  50% { top: 92%; opacity: 1; }
  100% { top: 0%; opacity: 0.9; }
}

.animate-scan {
  animation: scanline 1.6s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
