:root {
  color: #182033;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #eef2f7;
}

button,
input,
select {
  font: inherit;
}

.login-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background: #111827;
}

.login-panel {
  width: min(100%, 420px);
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
}

.login-brand {
  display: flex;
  gap: 14px;
  align-items: center;
  color: #101827;
}

.login-brand h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: 0;
}

.login-brand p {
  margin: 4px 0 0;
  color: #526176;
}

.login-form {
  display: grid;
  gap: 14px;
  margin-top: 26px;
}

.remembered-staff {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  height: 42px;
  border: 1px solid #bfd0e8;
  border-radius: 8px;
  background: #eef5ff;
  color: #123363;
  cursor: pointer;
  font-weight: 800;
}

.login-form label {
  display: grid;
  gap: 7px;
  color: #293445;
  font-size: 14px;
  font-weight: 700;
}

.login-form input {
  height: 42px;
  padding: 0 12px;
  border: 1px solid #cdd7e5;
  border-radius: 8px;
  outline: 0;
}

.login-form input:focus {
  border-color: #1e67ff;
  box-shadow: 0 0 0 3px rgba(30, 103, 255, 0.16);
}

.notice-check {
  grid-template-columns: auto 1fr !important;
  gap: 10px !important;
  align-items: start;
  color: #42526a !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  line-height: 1.4;
}

.notice-check input {
  width: 16px;
  height: 16px;
  margin-top: 1px;
  padding: 0;
}

.login-form button {
  height: 44px;
  border: 0;
  border-radius: 8px;
  background: #1455d9;
  color: #ffffff;
  cursor: pointer;
  font-weight: 800;
}

.login-form .remembered-staff {
  border: 1px solid #bfd0e8;
  background: #eef5ff;
  color: #123363;
}

.login-error {
  margin: 0;
  color: #b91c1c;
  font-size: 14px;
}

.admin-success {
  margin: 0;
  color: #166534;
  font-size: 14px;
  font-weight: 700;
}

.demo-credentials {
  display: grid;
  gap: 5px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #dce3ee;
  color: #526176;
  font-size: 13px;
}

.google-profile-note {
  display: grid;
  gap: 5px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #dbe6f3;
  border-radius: 8px;
  background: #f8fbff;
  color: #526176;
  font-size: 13px;
  line-height: 1.4;
}

.google-profile-note strong {
  color: #1d2b3f;
}

.admin-login-note {
  margin: 14px 0 0;
  color: #42526a;
  font-size: 13px;
  font-weight: 700;
}

.download-shell {
  min-height: 100vh;
  background: #f5f7fb;
  color: #172033;
}

.download-hero {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  padding: 22px clamp(18px, 5vw, 56px);
  background: #111827;
  color: #ffffff;
}

.download-brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
}

.download-brand h1 {
  margin: 0;
  font-size: 25px;
  letter-spacing: 0;
}

.download-brand p {
  margin: 3px 0 0;
  color: #cbd5e1;
}

.admin-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid #334155;
  border-radius: 8px;
  color: #ffffff;
  font-weight: 800;
  text-decoration: none;
}

.download-content {
  display: grid;
  gap: 14px;
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0;
}

.download-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 18px;
  border: 1px solid #d9e2ef;
  border-radius: 8px;
  background: #ffffff;
}

.download-card.primary {
  border-color: #b8cdf7;
  box-shadow: 0 10px 30px rgba(17, 24, 39, 0.08);
}

.download-card span {
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.download-card h2 {
  margin: 4px 0;
  font-size: 22px;
  letter-spacing: 0;
}

.download-card p {
  margin: 0;
  color: #526176;
}

.download-card a {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 8px;
  background: #1455d9;
  color: #ffffff;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.download-notes {
  padding: 14px 16px;
  border: 1px solid #d9e2ef;
  border-radius: 8px;
  background: #eef5ff;
  color: #334155;
}

.download-notes p {
  margin: 5px 0 0;
  line-height: 1.5;
}

.app-shell {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  height: 100vh;
  min-width: 760px;
  background: #f8fafc;
}

.topbar {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: center;
  padding: 10px 14px 0;
  background: #111827;
  color: #ffffff;
}

.brand {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-width: 150px;
  font-weight: 700;
}

.tabs {
  display: flex;
  gap: 6px;
  align-items: end;
  min-width: 0;
  overflow-x: auto;
}

.tab {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  width: 190px;
  max-width: 24vw;
  height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px 8px 0 0;
  background: #263244;
  color: #dbe4f0;
  cursor: pointer;
}

.tab span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tab.active {
  background: #f8fafc;
  color: #172033;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border: 1px solid #d8e0ec;
  border-radius: 8px;
  background: #ffffff;
  color: #1f2937;
  cursor: pointer;
}

.icon-button:disabled {
  cursor: default;
  opacity: 0.38;
}

.icon-button.active-tool {
  border-color: #f4c542;
  background: #fff8df;
  color: #8a5a00;
}

.toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid #d9e1ec;
  background: #f8fafc;
}

.address-form {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
  height: 40px;
  flex: 1;
  padding: 0 12px;
  border: 1px solid #ccd6e4;
  border-radius: 8px;
  background: #ffffff;
}

.address-form input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  color: #111827;
}

.shortcuts {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 14px;
  border-bottom: 1px solid #d9e1ec;
  background: #ffffff;
  overflow-x: auto;
}

.shortcuts button {
  height: 32px;
  padding: 0 12px;
  border: 1px solid #d6dfeb;
  border-radius: 8px;
  background: #f8fafc;
  color: #1f2937;
  cursor: pointer;
  white-space: nowrap;
}

.staff-chip {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  margin-left: auto;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.logout-button {
  border-color: #f1c7c7 !important;
  background: #fff5f5 !important;
  color: #991b1b !important;
}

.sync-chip {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 10px;
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.admin-shell {
  min-height: 100vh;
  background: #f8fafc;
  color: #172033;
}

.admin-header {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: #111827;
  color: #ffffff;
}

.admin-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.admin-content {
  display: grid;
  gap: 18px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0;
}

.admin-title h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: 0;
}

.admin-title p {
  margin: 5px 0 0;
  color: #64748b;
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.admin-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid #dde5f0;
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
}

.admin-card.selected {
  border-color: #1455d9;
  box-shadow: 0 0 0 3px rgba(20, 85, 217, 0.12);
}

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

.admin-card-head h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0;
}

.admin-card-head span {
  color: #64748b;
  font-size: 13px;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-top: 1px solid #eef2f7;
  border-bottom: 1px solid #eef2f7;
  color: #475569;
}

.admin-domains {
  display: grid;
  gap: 8px;
}

.report-tools {
  display: grid;
  grid-template-columns: 150px minmax(180px, 1fr) minmax(160px, 1fr) auto auto;
  gap: 10px;
  align-items: end;
  padding: 14px;
  border: 1px solid #dde5f0;
  border-radius: 8px;
  background: #ffffff;
}

.report-tools label {
  display: grid;
  gap: 6px;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.report-tools input,
.report-tools select {
  height: 38px;
  min-width: 0;
  padding: 0 10px;
  border: 1px solid #cdd7e5;
  border-radius: 8px;
  background: #ffffff;
  color: #172033;
  outline: 0;
  text-transform: none;
}

.report-tools button {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 0 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: #172033;
  cursor: pointer;
  font-weight: 800;
  white-space: nowrap;
}

.detail-panel {
  display: grid;
  gap: 16px;
  padding: 16px;
  border: 1px solid #dde5f0;
  border-radius: 8px;
  background: #ffffff;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.detail-grid article {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid #dde5f0;
  border-radius: 8px;
  background: #f8fafc;
}

.detail-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.detail-columns h3 {
  margin: 0 0 10px;
  font-size: 15px;
  letter-spacing: 0;
}

.detail-row {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 10px;
  border: 1px solid #dde5f0;
  border-radius: 8px;
  background: #f8fafc;
}

.detail-row + .detail-row {
  margin-top: 8px;
}

.detail-row strong,
.detail-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-row span {
  color: #64748b;
  font-size: 13px;
}

.staff-management {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 14px;
}

.staff-create-card,
.staff-list-card {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 16px;
  border: 1px solid #dde5f0;
  border-radius: 8px;
  background: #ffffff;
}

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

.section-title h2 {
  margin: 0;
  font-size: 17px;
  letter-spacing: 0;
}

.staff-form {
  display: grid;
  gap: 12px;
}

.autofill-decoy {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.staff-form label {
  display: grid;
  gap: 6px;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
}

.staff-form input,
.staff-form select,
.staff-actions input {
  height: 38px;
  min-width: 0;
  padding: 0 10px;
  border: 1px solid #cdd7e5;
  border-radius: 8px;
  background: #ffffff;
  color: #172033;
  outline: 0;
}

.field-hint {
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
}

.fixed-role {
  display: grid;
  gap: 6px;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
}

.fixed-role strong {
  display: flex;
  align-items: center;
  height: 38px;
  min-width: 0;
  padding: 0 10px;
  border: 1px solid #cdd7e5;
  border-radius: 8px;
  background: #f8fafc;
  color: #172033;
}

.staff-form button,
.staff-actions button {
  height: 38px;
  padding: 0 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: #172033;
  cursor: pointer;
  font-weight: 800;
  white-space: nowrap;
}

.staff-form button {
  border-color: #1455d9;
  background: #1455d9;
  color: #ffffff;
}

.staff-list {
  display: grid;
  gap: 10px;
}

.staff-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(0, auto);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid #dde5f0;
  border-radius: 8px;
  background: #f8fafc;
}

.staff-row strong,
.staff-row span {
  display: block;
}

.staff-row span {
  margin-top: 2px;
  color: #64748b;
  font-size: 13px;
}

.staff-actions {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}

.danger-button {
  border-color: #fecaca !important;
  background: #fff5f5 !important;
  color: #991b1b !important;
}

.danger-button:disabled {
  cursor: default;
  opacity: 0.45;
}

.workspace {
  display: grid;
  grid-template-columns: 260px 1fr;
  height: 100%;
  min-height: 0;
}

.report-panel {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 14px;
  border-right: 1px solid #d9e1ec;
  background: #f8fafc;
  color: #182033;
}

.report-panel > div:not(.domain-list) {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid #dde5f0;
  border-radius: 8px;
  background: #ffffff;
}

.report-label {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.domain-list {
  display: grid;
  gap: 8px;
  min-height: 0;
}

.opened-list {
  display: grid;
  gap: 8px;
  padding-top: 2px;
}

.domain-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid #dde5f0;
  border-radius: 8px;
  background: #ffffff;
  font-size: 13px;
}

.opened-row {
  display: grid;
  gap: 2px;
  padding: 9px 10px;
  border: 1px solid #dde5f0;
  border-radius: 8px;
  background: #ffffff;
  text-align: left;
}

.opened-row.action-row {
  width: 100%;
  cursor: pointer;
}

.opened-row.action-row:hover {
  border-color: #b8cdf7;
  background: #f8fbff;
}

.opened-row span {
  min-width: 0;
  overflow: hidden;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.opened-row small {
  color: #64748b;
  font-size: 12px;
}

.domain-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-report {
  color: #64748b;
  font-size: 13px;
}

.browser-stage {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  background: #0f172a;
  overflow: hidden;
}

.browser-frame {
  position: absolute;
  inset: 0;
  display: none;
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
  background: #0f172a;
  overflow: hidden;
  contain: layout paint size;
}

.browser-frame.visible {
  display: block;
}

.webview {
  position: absolute;
  inset: 0;
  display: inline-flex;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  border: 0;
  background: #0f172a;
}

.browser-error,
.browser-fallback {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-content: center;
  gap: 12px;
  padding: 24px;
  background: #ffffff;
  color: #172033;
  text-align: center;
}

.browser-error h2,
.browser-fallback h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0;
}

.browser-error p,
.browser-fallback p {
  width: min(520px, 100%);
  margin: 0 auto;
  color: #526176;
  line-height: 1.5;
}

.browser-error button {
  justify-self: center;
  height: 36px;
  padding: 0 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: #172033;
  cursor: pointer;
  font-weight: 700;
}

.browser-fallback code {
  justify-self: center;
  padding: 8px 10px;
  border: 1px solid #d8e0ec;
  border-radius: 8px;
  background: #f8fafc;
  color: #172033;
}

.spin {
  animation: spin 1s linear infinite;
}

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

@media (max-width: 760px) {
  .download-hero,
  .download-card {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .download-hero {
    display: grid;
  }

  .admin-link,
  .download-card a {
    justify-content: center;
  }

  .app-shell {
    min-width: 0;
  }

  .topbar {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .brand {
    min-width: 0;
  }

  .tab {
    width: 152px;
    max-width: 60vw;
  }

  .toolbar {
    flex-wrap: wrap;
  }

  .address-form {
    flex-basis: 100%;
    order: 2;
  }

  .shortcuts {
    flex-wrap: wrap;
  }

  .staff-chip {
    margin-left: 0;
  }

  .workspace {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .report-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-right: 0;
    border-bottom: 1px solid #d9e1ec;
  }

  .domain-list {
    grid-column: 1 / -1;
  }

  .opened-list {
    grid-column: 1 / -1;
  }

  .staff-management,
  .staff-row {
    grid-template-columns: 1fr;
  }

  .report-tools,
  .detail-grid,
  .detail-columns {
    grid-template-columns: 1fr;
  }

  .staff-actions {
    grid-template-columns: 1fr auto auto;
  }
}
