:root {
  --navy-950: #0b1f33;
  --navy-900: #102a43;
  --navy-800: #17324d;
  --navy-700: #244a68;
  --teal-700: #0f766e;
  --teal-600: #0d9488;
  --teal-100: #ccfbf1;
  --teal-50: #f0fdfa;
  --blue-50: #eff6ff;
  --slate-950: #182230;
  --slate-800: #344054;
  --slate-700: #475467;
  --slate-600: #667085;
  --slate-500: #98a2b3;
  --slate-300: #d0d5dd;
  --slate-200: #e4e7ec;
  --slate-100: #f2f4f7;
  --surface: #ffffff;
  --background: #f4f7fa;
  --warning: #b45309;
  --warning-bg: #fff7ed;
  --danger: #b42318;
  --danger-bg: #fef3f2;
  --success: #027a48;
  --success-bg: #ecfdf3;
  --shadow: 0 12px 34px rgba(16, 42, 67, 0.09);
  --radius-xl: 22px;
  --radius-lg: 16px;
  --radius-md: 12px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--background);
  color: var(--slate-950);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }

.skip-link {
  position: fixed;
  left: 16px;
  top: -80px;
  z-index: 10000;
  border-radius: 10px;
  background: #fff;
  color: var(--navy-900);
  padding: 10px 16px;
  box-shadow: var(--shadow);
}
.skip-link:focus { top: 12px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(228, 231, 236, 0.9);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
}
.header-inner {
  max-width: 1240px;
  margin: 0 auto;
  min-height: 76px;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-weight: 800;
  color: var(--navy-900);
  letter-spacing: -0.02em;
}
.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--navy-800), var(--teal-700));
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.22);
}
.brand-copy { display: grid; line-height: 1.25; }
.brand-copy small { color: var(--slate-600); font-size: 12px; font-weight: 700; letter-spacing: 0.05em; }
.top-nav { display: flex; align-items: center; gap: 8px; }
.top-nav a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 12px;
  color: var(--navy-800);
  font-size: 15px;
  font-weight: 750;
  text-decoration: none;
}
.top-nav a:hover { background: var(--slate-100); }

.container { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.page-main { padding: 34px 0 64px; }
.page-heading { margin-bottom: 26px; }
.eyebrow {
  margin: 0 0 8px;
  color: var(--teal-700);
  font-size: 14px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 { margin: 0; color: var(--navy-950); font-size: clamp(30px, 4vw, 46px); line-height: 1.25; letter-spacing: -0.035em; }
h2 { margin: 0; color: var(--navy-900); font-size: clamp(24px, 3vw, 32px); line-height: 1.35; letter-spacing: -0.025em; }
h3 { margin: 0; color: var(--navy-900); font-size: 20px; line-height: 1.45; }
.lead { margin: 12px 0 0; color: var(--slate-700); font-size: 18px; line-height: 1.8; }
.muted { color: var(--slate-600); }
.small { font-size: 14px; }

.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(42px, 7vw, 86px) 0;
  background:
    radial-gradient(circle at 88% 10%, rgba(13, 148, 136, 0.23), transparent 28%),
    radial-gradient(circle at 70% 80%, rgba(96, 165, 250, 0.15), transparent 35%),
    linear-gradient(135deg, #0b1f33, #17324d 58%, #0f5d5a);
  color: #fff;
}
.hero::after {
  content: "";
  position: absolute;
  width: 390px;
  height: 390px;
  right: -130px;
  bottom: -230px;
  border: 54px solid rgba(255,255,255,.06);
  border-radius: 50%;
}
.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr);
  align-items: center;
  gap: 48px;
}
.hero h1 { max-width: 760px; color: #fff; font-size: clamp(36px, 4.6vw, 52px); }
.hero .eyebrow { color: #79e6da; }
.hero .lead { max-width: 710px; color: rgba(255,255,255,.85); font-size: 19px; }
.hero-actions { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 12px; }
.hero-panel {
  padding: 28px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 24px;
  background: rgba(255,255,255,.1);
  backdrop-filter: blur(14px);
  box-shadow: 0 22px 50px rgba(3, 17, 30, .28);
}
.hero-panel h2 { color: #fff; font-size: 23px; }
.hero-panel ul { margin: 18px 0 0; padding: 0; list-style: none; display: grid; gap: 13px; }
.hero-panel li { display: flex; gap: 10px; color: rgba(255,255,255,.91); }
.hero-panel li::before { content: "✓"; flex: 0 0 26px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: rgba(121,230,218,.18); color: #79e6da; font-weight: 900; }

.section { padding: 62px 0; }
.section-tight { padding: 34px 0; }
.section-head { margin-bottom: 26px; display: flex; align-items: end; justify-content: space-between; gap: 18px; }
.section-head p { margin: 6px 0 0; color: var(--slate-600); }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.card {
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: 0 4px 14px rgba(16, 42, 67, 0.04);
}
.card-pad { padding: 24px; }
.action-card { padding: 26px; display: flex; flex-direction: column; min-height: 250px; }
.action-card .icon-tile { margin-bottom: 22px; }
.action-card p { color: var(--slate-600); }
.action-card .btn { margin-top: auto; }
.icon-tile { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 16px; background: var(--teal-50); color: var(--teal-700); font-size: 25px; }

.btn {
  min-height: 50px;
  border: 1px solid transparent;
  border-radius: 13px;
  padding: 11px 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 800;
  text-decoration: none;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .nav-button:focus-visible { outline: 3px solid rgba(13, 148, 136, .3); outline-offset: 2px; }
.btn-primary { background: var(--teal-700); color: #fff; box-shadow: 0 8px 18px rgba(15,118,110,.19); }
.btn-primary:hover { background: #0b665f; }
.btn-navy { background: var(--navy-800); color: #fff; box-shadow: 0 8px 18px rgba(23,50,77,.17); }
.btn-light { border-color: rgba(255,255,255,.28); background: rgba(255,255,255,.12); color: #fff; }
.btn-secondary { border-color: var(--slate-300); background: #fff; color: var(--navy-800); }
.btn-danger { border-color: #fecdca; background: var(--danger-bg); color: var(--danger); }
.btn-ghost { background: transparent; color: var(--navy-800); }
.btn-sm { min-height: 40px; padding: 8px 12px; font-size: 14px; border-radius: 10px; }
.btn-block { width: 100%; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.form-card { padding: clamp(22px, 4vw, 36px); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.field { display: grid; gap: 7px; }
.field-full { grid-column: 1 / -1; }
.field label, .label { color: var(--slate-800); font-size: 15px; font-weight: 800; }
.required { color: var(--danger); font-size: 13px; margin-left: 4px; }
input, select, textarea {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--slate-300);
  border-radius: 12px;
  background: #fff;
  color: var(--slate-950);
  padding: 11px 13px;
  font-size: 17px;
}
textarea { min-height: 128px; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--slate-500); }
.check-row { display: flex; align-items: flex-start; gap: 11px; }
.check-row input { width: 22px; height: 22px; min-height: 0; margin-top: 3px; accent-color: var(--teal-700); }
.security-notice { padding: 16px 18px; display: flex; gap: 12px; border: 1px solid #fedf89; border-radius: 14px; background: #fffaeb; color: #7a2e0e; }
.security-notice strong { display: block; }

.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 9px; }
.slot-button { min-height: 48px; border: 1px solid var(--slate-300); border-radius: 11px; background: #fff; color: var(--navy-800); cursor: pointer; font-weight: 800; }
.slot-button:hover:not(:disabled), .slot-button.selected { border-color: var(--teal-700); background: var(--teal-50); color: var(--teal-700); }
.slot-button:disabled { background: var(--slate-100); color: var(--slate-500); cursor: not-allowed; text-decoration: line-through; }

.alert { margin: 0 0 18px; padding: 15px 17px; border-radius: 13px; font-weight: 700; }
.alert-success { border: 1px solid #abefc6; background: var(--success-bg); color: var(--success); }
.alert-error { border: 1px solid #fecdca; background: var(--danger-bg); color: var(--danger); }
.alert-info { border: 1px solid #b2ddff; background: var(--blue-50); color: #175cd3; }

.status { display: inline-flex; align-items: center; min-height: 30px; border-radius: 999px; padding: 3px 10px; background: var(--slate-100); color: var(--slate-700); font-size: 13px; font-weight: 850; white-space: nowrap; }
.status[data-tone="success"] { background: var(--success-bg); color: var(--success); }
.status[data-tone="warning"] { background: var(--warning-bg); color: var(--warning); }
.status[data-tone="danger"] { background: var(--danger-bg); color: var(--danger); }
.status[data-tone="info"] { background: var(--blue-50); color: #175cd3; }

.portal-shell { min-height: 100vh; }
.portal-topbar { background: var(--navy-900); color: #fff; }
.portal-topbar .header-inner { min-height: 72px; }
.portal-topbar .brand, .portal-topbar .brand-copy small { color: #fff; }
.portal-topbar .brand-mark { background: rgba(255,255,255,.14); box-shadow: none; }
.user-chip { display: flex; align-items: center; gap: 10px; }
.user-avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--teal-600); color: #fff; font-weight: 900; }
.portal-hero { padding: 30px 0; background: linear-gradient(135deg, #eaf4f7, #f3faf9); border-bottom: 1px solid var(--slate-200); }
.portal-hero-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.portal-hero h1 { font-size: clamp(28px, 4vw, 38px); }
.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-top: 22px; }
.summary-card { padding: 18px; border: 1px solid var(--slate-200); border-radius: 16px; background: #fff; }
.summary-card .value { margin-top: 6px; color: var(--navy-900); font-size: 28px; font-weight: 900; line-height: 1.2; }
.summary-card .label { color: var(--slate-600); font-size: 14px; }

.tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.tab-button { min-height: 48px; flex: 0 0 auto; border: 1px solid var(--slate-300); border-radius: 12px; background: #fff; color: var(--slate-700); padding: 10px 17px; cursor: pointer; font-weight: 800; }
.tab-button.active { border-color: var(--navy-800); background: var(--navy-800); color: #fff; }
.panel { margin-top: 22px; }
.list { display: grid; gap: 13px; }
.list-item { padding: 20px; border: 1px solid var(--slate-200); border-radius: 16px; background: #fff; }
.list-item-head { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; }
.list-item p { margin: 7px 0 0; color: var(--slate-600); }
.meta-row { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 12px; color: var(--slate-700); font-size: 14px; }
.progress { width: 100%; height: 9px; overflow: hidden; margin-top: 14px; border-radius: 999px; background: var(--slate-100); }
.progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--teal-700), #2dd4bf); }
.empty { padding: 38px 22px; text-align: center; border: 1px dashed var(--slate-300); border-radius: 16px; background: rgba(255,255,255,.6); color: var(--slate-600); }

.admin-layout { min-height: 100vh; display: grid; grid-template-columns: 276px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 22px 16px; background: var(--navy-950); color: #fff; }
.sidebar .brand { margin: 0 8px 24px; color: #fff; }
.sidebar .brand-copy small { color: rgba(255,255,255,.65); }
.side-label { margin: 20px 12px 8px; color: rgba(255,255,255,.52); font-size: 12px; font-weight: 850; letter-spacing: .09em; }
.side-nav { display: grid; gap: 5px; }
.nav-button { width: 100%; min-height: 48px; border: 0; border-radius: 12px; padding: 10px 12px; display: flex; align-items: center; gap: 12px; background: transparent; color: rgba(255,255,255,.76); cursor: pointer; font-size: 16px; font-weight: 750; text-align: left; }
.nav-button:hover, .nav-button.active { background: rgba(255,255,255,.11); color: #fff; }
.nav-icon { width: 26px; text-align: center; font-size: 20px; }
.admin-main { min-width: 0; }
.admin-topbar { position: sticky; top: 0; z-index: 80; min-height: 76px; padding: 12px 28px; border-bottom: 1px solid var(--slate-200); background: rgba(255,255,255,.94); backdrop-filter: blur(12px); display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.admin-content { padding: 30px; }
.admin-page-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.admin-page-head h1 { font-size: 31px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.metric { padding: 20px; border: 1px solid var(--slate-200); border-radius: 18px; background: #fff; box-shadow: 0 3px 12px rgba(16,42,67,.035); }
.metric-top { display: flex; justify-content: space-between; gap: 14px; align-items: center; color: var(--slate-600); font-size: 14px; font-weight: 750; }
.metric-value { margin-top: 10px; color: var(--navy-900); font-size: 34px; line-height: 1.1; font-weight: 900; }
.metric-note { margin-top: 8px; color: var(--slate-600); font-size: 13px; }
.dashboard-grid { display: grid; grid-template-columns: 1.35fr .65fr; gap: 18px; margin-top: 18px; }
.panel-card { padding: 22px; border: 1px solid var(--slate-200); border-radius: 18px; background: #fff; }
.panel-card-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.panel-card-head h2 { font-size: 21px; }
.toolbar { margin-bottom: 16px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.toolbar .search { min-width: 260px; max-width: 460px; flex: 1 1 280px; }
.toolbar select { width: auto; min-width: 160px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--slate-200); border-radius: 16px; background: #fff; }
table { width: 100%; border-collapse: collapse; min-width: 780px; }
th, td { padding: 14px 15px; border-bottom: 1px solid var(--slate-200); text-align: left; vertical-align: middle; }
th { background: #f8fafc; color: var(--slate-700); font-size: 13px; font-weight: 850; white-space: nowrap; }
td { font-size: 15px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfdfd; }
.table-actions { display: flex; gap: 7px; flex-wrap: wrap; }

.settings-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr); gap: 18px; align-items: start; }
.settings-main { margin: 0; }
.settings-side { display: grid; gap: 18px; }
.section-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-title h2 { font-size: 22px; }
.schedule-list { display: grid; gap: 0; }
.schedule-row { min-height: 44px; padding: 10px 2px; border-bottom: 1px solid var(--slate-200); display: flex; justify-content: space-between; gap: 16px; }
.schedule-row:last-child { border-bottom: 0; }
.schedule-note { margin-top: 14px; padding: 14px; border-radius: 13px; background: var(--warning-bg); color: #7c4a03; display: grid; gap: 6px; font-size: 14px; }
.notice-card { border-color: #cbd5e1; background: #f8fafc; }
.notice-card p { margin: 8px 0 0; line-height: 1.75; }

.modal-wide { width: min(920px, 100%); }
.search-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; }
.client-search-results { display: grid; gap: 8px; margin-top: 10px; }
.client-result { width: 100%; min-height: 62px; padding: 12px 14px; border: 1px solid var(--slate-200); border-radius: 13px; background: #fff; color: var(--navy-900); cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px; text-align: left; }
.client-result:hover { border-color: var(--teal-600); background: var(--teal-50); }
.client-result span:first-child { display: grid; gap: 3px; }
.client-result small { color: var(--slate-600); }
.client-result-phone { color: var(--teal-800); font-weight: 800; white-space: nowrap; }
.selected-client { padding: 18px; border: 2px solid #99f6e4; border-radius: 16px; background: var(--teal-50); }
.selected-client-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; }
.selected-client-head h3 { margin-top: 8px; }
.selected-client-head p { margin: 5px 0 0; }
.selected-client-metrics { margin-top: 14px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.selected-client-metrics span { padding: 10px; border-radius: 10px; background: #fff; color: var(--slate-700); font-size: 13px; text-align: center; }
.selected-client-metrics strong { display: block; margin-top: 3px; color: var(--navy-900); font-size: 20px; }
.contact-choice { margin-top: 14px; padding-top: 14px; border-top: 1px solid #99f6e4; }
.contact-choice > strong { display: block; margin-bottom: 9px; }

.auth-screen { min-height: 100vh; display: grid; place-items: center; padding: 30px; background: radial-gradient(circle at 20% 10%, rgba(13,148,136,.18), transparent 27%), linear-gradient(145deg, var(--navy-950), var(--navy-800)); }
.auth-card { width: min(480px, 100%); padding: 34px; border-radius: 24px; background: #fff; box-shadow: 0 28px 70px rgba(0,0,0,.28); }
.auth-card .brand { margin-bottom: 26px; }
.admin-code-row { display: grid; grid-template-columns: 1fr auto; gap: 9px; }
.admin-code-row .btn { padding-inline: 14px; }

.ipad-body { background: #eaf0f4; font-size: 18px; }
.ipad-header { padding: 16px 24px; background: var(--navy-900); color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.ipad-header .brand, .ipad-header .brand-copy small { color: #fff; }
.ipad-main { padding: 24px; }
.ipad-metrics { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; }
.ipad-card { min-height: 128px; padding: 20px; border: 1px solid var(--slate-200); border-radius: 20px; background: #fff; }
.ipad-card .value { font-size: 38px; font-weight: 900; color: var(--navy-900); }
.ipad-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
.ipad-action { min-height: 62px; font-size: 18px; }
.ipad-item-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.ipad-item-actions .ipad-action { flex: 1 1 150px; }
.ipad-item-actions .ipad-action:disabled { cursor: not-allowed; opacity: .7; }
.ipad-safety-note { margin: 10px 0 0; }

.check-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.check-card { padding: 22px; border: 1px solid var(--slate-200); border-radius: 18px; background: #fff; }
.check-indicator { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: var(--slate-100); color: var(--slate-600); font-size: 23px; font-weight: 900; }
.check-indicator.ok { background: var(--success-bg); color: var(--success); }
.check-indicator.ng { background: var(--danger-bg); color: var(--danger); }
.check-card h3 { margin-top: 15px; }
.check-card p { margin: 6px 0 0; color: var(--slate-600); font-size: 14px; }

.hours-editor { display: grid; gap: 10px; margin: 18px 0; }
.hours-row { display: grid; grid-template-columns: 90px minmax(110px,1fr) auto minmax(110px,1fr) auto; gap: 10px; align-items: center; padding: 12px; border: 1px solid var(--slate-200); border-radius: 13px; background: var(--slate-50); }
.hours-row > strong { color: var(--navy-900); }
.hours-row > span { color: var(--slate-500); font-weight: 800; }
.hours-closed, .switch-label { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--slate-700); }
.settings-item-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.compact-form { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; margin-top: 16px; }
.closed-date-list { display: grid; gap: 9px; margin-top: 18px; }
.closed-date-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 14px; border: 1px solid var(--slate-200); border-radius: 13px; background: var(--slate-50); }
.closed-date-row strong { color: var(--navy-900); }
.closed-date-row small { display: block; margin-top: 3px; color: var(--slate-600); }
.compact-empty { padding: 16px; border: 1px dashed var(--slate-300); border-radius: 13px; color: var(--slate-600); text-align: center; }
.check-fieldset { display: flex; gap: 18px; flex-wrap: wrap; padding: 15px; border: 1px solid var(--slate-300); border-radius: 13px; }
.check-fieldset legend { padding: 0 6px; font-weight: 800; color: var(--navy-900); }
.check-fieldset label { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; }
.submission-history { display: grid; gap: 8px; margin-top: 11px; }
.submission-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 12px; border: 1px solid var(--slate-200); border-radius: 12px; background: #fff; }
.submission-row strong { display: block; color: var(--navy-900); overflow-wrap: anywhere; }
.submission-row small { display: block; margin-top: 3px; color: var(--slate-600); }
.file-selection { margin-top: 10px; padding: 12px 14px; border: 1px solid #99f6e4; border-radius: 12px; background: var(--teal-50); color: var(--teal-800); font-weight: 700; overflow-wrap: anywhere; }
.file-selection.error { border-color: #fecaca; background: var(--danger-bg); color: var(--danger); }
.document-review-summary { display: grid; gap: 14px; }
.review-file-card { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 18px; border: 1px solid var(--slate-200); border-radius: 16px; background: var(--slate-50); }
.review-file-card h3 { margin-top: 9px; overflow-wrap: anywhere; }
.review-file-card p { margin: 6px 0 0; color: var(--slate-600); }
.review-context-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.review-context-grid span { padding: 13px; border: 1px solid var(--slate-200); border-radius: 12px; color: var(--slate-600); font-size: 13px; }
.review-context-grid strong { display: block; margin-top: 4px; color: var(--navy-900); font-size: 15px; }
.document-open-actions { align-items: center; margin: 16px 0; padding: 15px; border: 1px solid var(--slate-200); border-radius: 14px; background: #f7fbfb; }
.document-open-actions .btn:disabled { cursor: not-allowed; opacity: .75; background: #edf1f4; color: #667788; border-color: #d9e0e6; box-shadow: none; }
@media (max-width: 640px) { .document-open-actions { align-items: stretch; flex-direction: column; } .document-open-actions .btn { width: 100%; } }
.document-review-form { display: grid; gap: 15px; }
.review-action-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.document-audit { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--slate-200); }
.timeline-list { display: grid; gap: 0; margin-top: 12px; }
.timeline-row { position: relative; display: grid; grid-template-columns: 20px 1fr; gap: 9px; min-height: 54px; }
.timeline-row::before { content: ""; position: absolute; left: 6px; top: 15px; bottom: -2px; width: 2px; background: var(--slate-200); }
.timeline-row:last-child::before { display: none; }
.timeline-dot { z-index: 1; width: 14px; height: 14px; margin-top: 3px; border: 3px solid #ccfbf1; border-radius: 50%; background: var(--teal-700); }
.timeline-row strong, .timeline-row small { display: block; }
.timeline-row small { margin-top: 3px; color: var(--slate-600); }

.modal-backdrop { position: fixed; inset: 0; z-index: 1000; padding: 24px; display: grid; place-items: center; background: rgba(5,18,30,.62); }
.modal { width: min(720px, 100%); max-height: calc(100vh - 48px); overflow-y: auto; border-radius: 22px; background: #fff; box-shadow: 0 28px 80px rgba(0,0,0,.3); }
.modal-head { position: sticky; top: 0; z-index: 2; padding: 20px 24px; border-bottom: 1px solid var(--slate-200); background: #fff; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.modal-head h2 { font-size: 23px; }
.modal-body { padding: 24px; }
.icon-button { width: 44px; height: 44px; border: 1px solid var(--slate-300); border-radius: 12px; background: #fff; color: var(--slate-700); cursor: pointer; font-size: 21px; }
.toast-stack { position: fixed; right: 18px; bottom: 18px; z-index: 2000; width: min(390px, calc(100% - 36px)); display: grid; gap: 10px; }
.toast { padding: 15px 17px; border-radius: 13px; background: var(--navy-950); color: #fff; box-shadow: var(--shadow); font-weight: 700; animation: toast-in .2s ease-out; }
.toast.error { background: var(--danger); }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }
.spinner { width: 22px; height: 22px; border: 3px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .65s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { min-height: 180px; display: grid; place-items: center; color: var(--teal-700); }
.mobile-menu { display: none; }

.site-footer { padding: 30px 0; border-top: 1px solid var(--slate-200); background: #fff; color: var(--slate-600); font-size: 14px; }
.footer-row { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }

@media (max-width: 1020px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-panel { max-width: 700px; }
  .metric-grid, .summary-grid, .ipad-metrics { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .admin-layout { grid-template-columns: 230px minmax(0,1fr); }
  .card-grid, .check-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .settings-layout { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  body { font-size: 17px; }
  .container { width: min(100% - 28px, 1180px); }
  .header-inner { min-height: 68px; padding: 10px 14px; }
  .brand-copy span { font-size: 15px; }
  .top-nav { display: none; }
  .mobile-menu { display: inline-flex; }
  .hero { padding: 44px 0; }
  .hero-grid { gap: 30px; }
  .hero-panel { padding: 22px; }
  .section { padding: 42px 0; }
  .card-grid, .form-grid, .summary-grid, .metric-grid, .check-grid, .ipad-metrics, .ipad-columns { grid-template-columns: 1fr; }
  .field-full { grid-column: auto; }
  .portal-hero-row, .section-head, .admin-page-head { align-items: flex-start; flex-direction: column; }
  .admin-layout { display: block; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 500; width: min(310px, 88vw); transform: translateX(-105%); transition: transform .22s ease; box-shadow: 12px 0 40px rgba(0,0,0,.24); }
  .sidebar.open { transform: translateX(0); }
  .admin-topbar { min-height: 68px; padding: 10px 14px; }
  .admin-content { padding: 22px 14px 42px; }
  .admin-page-head h1 { font-size: 27px; }
  .toolbar .search, .toolbar select { width: 100%; max-width: none; }
  .ipad-main { padding: 14px; }
  .ipad-header { padding: 12px 14px; }
  .auth-card { padding: 26px 21px; }
  .modal-backdrop { padding: 10px; }
  .modal { max-height: calc(100vh - 20px); }
  .modal-body, .modal-head { padding: 18px; }
  .search-row { grid-template-columns: 1fr; }
  .client-result, .selected-client-head { align-items: flex-start; flex-direction: column; }
  .selected-client-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hours-row { grid-template-columns: 70px 1fr auto 1fr; }
  .hours-closed { grid-column: 1 / -1; }
  .compact-form { grid-template-columns: 1fr; }
  .compact-form .field-full { grid-column: auto; }
  .closed-date-row { align-items: flex-start; }
  .submission-row { align-items: flex-start; flex-direction: column; }
  .review-context-grid, .review-action-grid { grid-template-columns: 1fr; }
  .review-file-card { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation-duration: .001ms !important; }
}
