:root {
  color-scheme: light;
  --primary: #1e1b4b;
  --primary-hover: #312e81;
  --brand-soft: #e9ebfb;
  --background: #f9fafb;
  --card: #fff;
  --muted: #f3f4f6;
  --border: #e5e7eb;
  --text: #111827;
  --sub: #6b7280;
  --success: #047857;
  --success-bg: #e8f7ef;
  --warn: #a45b08;
  --warn-bg: #fff5e2;
  --danger: #be3143;
  --danger-bg: #fff0f2;
  --shadow:
    0 1px 3px rgba(17, 24, 39, 0.045), 0 10px 24px rgba(17, 24, 39, 0.025);
  font-family:
    "Pretendard Variable",
    Pretendard,
    -apple-system,
    BlinkMacSystemFont,
    "Apple SD Gothic Neo",
    "Noto Sans KR",
    sans-serif;
}
:root.dark {
  color-scheme: dark;
  --primary: #29366d;
  --primary-hover: #35448a;
  --brand-soft: #262c4e;
  --background: #0a0a0a;
  --card: #171717;
  --muted: #262626;
  --border: #404040;
  --text: #f9fafb;
  --sub: #a3a3a3;
  --success: #6ee7b7;
  --success-bg: #163a2b;
  --warn: #fcd184;
  --warn-bg: #3a2b17;
  --danger: #fda4af;
  --danger-bg: #3b1e25;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.13);
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  background: var(--background);
  color: var(--text);
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  min-width: 0;
  line-height: 1.5;
  font-size: 16px;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
button,
input,
select,
textarea,
a {
  outline-offset: 3px;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid #818cf8;
}
a {
  color: inherit;
  text-decoration: none;
}
svg {
  display: block;
  flex: none;
}
.icon {
  width: 20px;
  height: 20px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3 {
  line-height: 1.3;
  letter-spacing: -0.035em;
}
h1 {
  font-size: clamp(1.65rem, 3vw, 2.15rem);
}
h2 {
  font-size: 1.16rem;
}
h3 {
  font-size: 1rem;
}
small {
  font-size: 0.8rem;
}
.muted {
  color: var(--sub);
}
.eyebrow {
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #858ab0;
}
.initial-loading {
  min-height: 100vh;
  display: grid;
  place-items: center;
  color: var(--sub);
}
button {
  border: 0;
  background: none;
  color: inherit;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.65rem 1rem;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.9rem;
  border: 1px solid transparent;
  transition:
    background-color 0.18s,
    border-color 0.18s,
    transform 0.1s;
}
.btn:active {
  transform: scale(0.98);
}
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-hover);
}
.btn-secondary {
  background: var(--card);
  border-color: var(--border);
  color: var(--text);
}
.btn-secondary:hover {
  background: var(--muted);
}
.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
}
.btn-small {
  min-height: 48px;
  padding: 0.5rem 0.8rem;
  font-size: 0.84rem;
}
.icon-button {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  color: var(--sub);
}
.icon-button:hover {
  background: var(--muted);
  color: var(--text);
}
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(
      circle at 19% 19%,
      rgba(99, 102, 241, 0.09),
      transparent 38%
    ),
    radial-gradient(circle at 85% 82%, rgba(30, 27, 75, 0.07), transparent 34%),
    var(--background);
}
.login-layout {
  width: min(100%, 440px);
}
.login-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 38px 32px;
}
.login-brand {
  text-align: center;
}
.login-brand img {
  display: block;
  width: 106px;
  max-height: 38px;
  object-fit: contain;
  margin: 0 auto 30px;
}
.login-mark {
  width: 56px;
  height: 56px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--primary);
  border-radius: 18px;
}
.login-brand h1 {
  font-size: 1.6rem;
}
.login-brand p {
  color: var(--sub);
  font-size: 0.92rem;
  margin-top: 10px;
  word-break: keep-all;
}
.login-form {
  display: grid;
  gap: 16px;
  margin-top: 28px;
}
.field {
  display: grid;
  gap: 7px;
  min-width: 0;
}
.field label {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text);
}
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 48px;
  padding: 10px 13px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  line-height: 1.45;
}
.field textarea {
  min-height: 96px;
  resize: vertical;
}
.field input::placeholder {
  color: var(--sub);
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: #818cf8;
}
.field select {
  appearance: none;
  background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%236b7280" stroke-width="2"%3E%3Cpath d="m6 9 6 6 6-6"/%3E%3C/svg%3E');
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}
.field input[type="file"] {
  padding: 9px;
  font-size: 0.85rem;
}
.login-form .btn {
  width: 100%;
  margin-top: 4px;
}
.login-footer {
  text-align: center;
  color: var(--sub);
  font-size: 0.82rem;
  margin-top: 18px;
}
.error {
  color: var(--danger);
  font-size: 0.88rem;
  word-break: keep-all;
}
.login-theme {
  position: fixed;
  right: 20px;
  top: 20px;
  background: var(--card);
  border: 1px solid var(--border);
}
.topbar {
  height: 68px;
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  height: 100%;
  max-width: 1470px;
  margin: auto;
  padding: 0 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.brand img {
  width: 75px;
  max-height: 30px;
  object-fit: contain;
}
.brand-divider {
  width: 1px;
  height: 23px;
  background: var(--border);
}
.brand-name {
  font-size: 0.9rem;
  font-weight: 800;
  white-space: nowrap;
  letter-spacing: -0.02em;
}
.brand-name span {
  color: var(--sub);
  font-weight: 500;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.account {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
}
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--text);
  font-weight: 800;
}
.logout {
  color: var(--sub);
  font-size: 0.8rem;
  min-height: 48px;
  padding: 0 8px;
}
.logout:hover {
  color: var(--text);
}
.shell {
  max-width: 1470px;
  margin: auto;
  display: grid;
  grid-template-columns: 215px minmax(0, 1fr);
  gap: 30px;
  padding: 28px 30px 70px;
}
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 8px;
}
.side-label {
  color: var(--sub);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin: 8px 12px 4px;
}
.nav-item {
  min-height: 48px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 10px 12px;
  color: var(--sub);
  font-size: 0.9rem;
  font-weight: 650;
  white-space: nowrap;
}
.nav-item:hover {
  background: var(--muted);
  color: var(--text);
}
.nav-item.active {
  background: var(--primary);
  color: #fff;
}
.side-bottom {
  margin-top: 34px;
  padding: 16px 12px;
  border-top: 1px solid var(--border);
  font-size: 0.76rem;
  color: var(--sub);
  line-height: 1.6;
}
.main {
  min-width: 0;
  max-width: 1150px;
  width: 100%;
}
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 4px 0 22px;
}
.page-head .eyebrow {
  margin-bottom: 7px;
}
.page-head p.desc {
  margin-top: 6px;
  color: var(--sub);
  font-size: 0.92rem;
  word-break: keep-all;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 8px;
  background: var(--muted);
  color: var(--sub);
  font-size: 0.75rem;
  font-weight: 750;
  white-space: nowrap;
}
.badge.live {
  background: var(--success-bg);
  color: var(--success);
}
.badge.warn {
  background: var(--warn-bg);
  color: var(--warn);
}
.badge.best {
  background: #fff3d3;
  color: #9a6400;
}
.badge.out {
  background: var(--danger-bg);
  color: var(--danger);
}
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.card-pad {
  padding: 22px;
}
.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.card-head p {
  font-size: 0.84rem;
  color: var(--sub);
  margin-top: 4px;
}
.card-link {
  color: var(--sub);
  font-size: 0.8rem;
  font-weight: 700;
  min-height: 48px;
  white-space: nowrap;
}
.card-link:hover {
  color: var(--text);
}
.hero {
  display: flex;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  background: #1e1b4b;
  color: white;
  border: 0;
  padding: 28px 30px;
  min-height: 186px;
}
.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 70%;
}
.hero .eyebrow {
  color: #c9cdfd;
}
.hero h2 {
  font-size: clamp(1.35rem, 2.5vw, 1.8rem);
  margin: 12px 0 8px;
}
.hero p {
  font-size: 0.89rem;
  color: #d0d3eb;
  word-break: keep-all;
}
.hero .hero-meta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 18px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #e0e7ff;
}
.hero-art {
  position: absolute;
  right: 28px;
  top: -17px;
  width: 240px;
  height: 220px;
  color: #d0d4ff;
  opacity: 0.92;
}
.hero-art svg {
  width: 100%;
  height: 100%;
}
.hero:after {
  content: "";
  position: absolute;
  right: -70px;
  top: -85px;
  width: 270px;
  height: 270px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 50%;
  box-shadow:
    0 0 0 38px rgba(255, 255, 255, 0.025),
    0 0 0 76px rgba(255, 255, 255, 0.025);
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 16px 0;
}
.metric {
  padding: 19px 20px;
}
.metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--sub);
  font-size: 0.83rem;
  font-weight: 650;
}
.metric-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--brand-soft);
  color: #5659a8;
}
.dark .metric-icon {
  color: #c7d2fe;
}
.metric-icon .icon {
  width: 18px;
  height: 18px;
}
.metric-number {
  font-size: 1.72rem;
  font-weight: 800;
  letter-spacing: -0.05em;
  margin-top: 12px;
}
.metric-number span {
  font-size: 0.85rem;
  color: var(--sub);
  font-weight: 600;
  margin-left: 3px;
}
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.14fr 0.86fr;
  gap: 16px;
}
.stack {
  display: grid;
  gap: 16px;
  align-content: start;
}
.profile-strip {
  display: flex;
  align-items: center;
  gap: 14px;
}
.profile-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: var(--brand-soft);
  color: var(--text);
  font-weight: 800;
}
.profile-main {
  flex: 1;
  min-width: 0;
}
.profile-main strong {
  font-size: 0.95rem;
}
.profile-main p {
  font-size: 0.8rem;
  color: var(--sub);
  margin-top: 2px;
}
.profile-stats {
  display: flex;
  gap: 25px;
  margin-top: 20px;
  padding-top: 17px;
  border-top: 1px solid var(--border);
}
.profile-stats span {
  display: block;
  font-size: 0.78rem;
  color: var(--sub);
}
.profile-stats strong {
  font-size: 1.16rem;
}
.rows {
  display: grid;
}
.rank-row,
.event-row,
.person-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}
.rank-row:first-child,
.event-row:first-child,
.person-row:first-child {
  border-top: 0;
}
.rank-number {
  font-size: 0.86rem;
  font-weight: 800;
  width: 25px;
  text-align: center;
  color: var(--sub);
}
.rank-number.first {
  color: #a9781b;
}
.rank-avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}
.row-text {
  min-width: 0;
  flex: 1;
}
.row-text strong {
  display: block;
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}
.row-text span {
  display: block;
  font-size: 0.77rem;
  color: var(--sub);
  margin-top: 2px;
}
.row-value {
  font-size: 0.88rem;
  font-weight: 800;
  white-space: nowrap;
}
.row-value small {
  color: var(--sub);
  font-weight: 600;
}
.event-icon {
  width: 37px;
  height: 37px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #7776b2;
  background: var(--brand-soft);
}
.event-icon .icon {
  width: 18px;
}
.empty {
  padding: 28px 12px;
  text-align: center;
  color: var(--sub);
  font-size: 0.87rem;
  word-break: keep-all;
}
.empty-symbol {
  margin: 0 auto 10px;
  width: 46px;
  height: 46px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  background: var(--muted);
  color: var(--sub);
}
.tabs {
  display: flex;
  overflow-x: auto;
  gap: 6px;
  padding: 5px;
  background: var(--muted);
  border-radius: 12px;
  width: max-content;
  max-width: 100%;
  margin-bottom: 20px;
}
.tab {
  min-height: 48px;
  padding: 8px 14px;
  border-radius: 9px;
  color: var(--sub);
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
}
.tab.active {
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow);
}
.content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.form-stack {
  display: grid;
  gap: 14px;
}
.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 2px;
}
.hint {
  font-size: 0.81rem;
  color: var(--sub);
  word-break: keep-all;
}
.notice {
  padding: 13px 15px;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--text);
  font-size: 0.85rem;
  word-break: keep-all;
  margin-bottom: 16px;
}
.admin-list {
  margin-top: 16px;
}
.admin-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.list-card {
  padding: 15px 0;
  border-top: 1px solid var(--border);
}
.list-card:first-child {
  border-top: 0;
}
.list-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.list-card p {
  font-size: 0.82rem;
  color: var(--sub);
  margin-top: 5px;
}
.list-form {
  margin-top: 12px;
}
.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  text-align: left;
}
th,
td {
  padding: 13px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
th {
  font-size: 0.76rem;
  color: var(--sub);
  font-weight: 700;
}
td {
  overflow-wrap: anywhere;
}
tr:last-child td {
  border-bottom: 0;
}
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.photo-card {
  overflow: hidden;
}
.photo-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  background: var(--muted);
}
.photo-meta {
  padding: 15px;
}
.photo-meta h3 {
  font-size: 0.9rem;
}
.photo-meta p {
  font-size: 0.78rem;
  color: var(--sub);
  margin-top: 5px;
}
.photo-meta .admin-controls {
  margin-top: 13px;
}
.photo-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 9px;
}
.upload-card {
  margin-top: 20px;
}
.my-record {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.my-record .metric-number {
  margin-top: 5px;
}
.section-gap {
  margin-top: 20px;
}
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  max-width: calc(100vw - 32px);
  padding: 12px 18px;
  background: #1f2937;
  color: #fff;
  border-radius: 12px;
  font-size: 0.85rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  display: none;
}
#toast.visible {
  display: block;
}
@media (max-width: 900px) {
  .shell {
    display: block;
    padding: 20px 20px 60px;
  }
  .sidebar {
    flex-direction: row;
    overflow-x: auto;
    padding: 0 0 14px;
    margin-bottom: 8px;
    gap: 5px;
    scrollbar-width: thin;
  }
  .side-label,
  .side-bottom {
    display: none;
  }
  .nav-item {
    flex: none;
  }
  .dashboard-grid {
    grid-template-columns: 1fr 1fr;
  }
  .photo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 620px) {
  .topbar {
    height: 62px;
  }
  .topbar-inner {
    padding: 0 14px;
  }
  .brand {
    gap: 9px;
  }
  .brand img {
    width: 62px;
  }
  .brand-name {
    font-size: 0.8rem;
  }
  .brand-name span,
  .account .account-name {
    display: none;
  }
  .top-actions {
    gap: 0;
  }
  .shell {
    padding: 15px 14px 50px;
  }
  .sidebar {
    margin: 0 -14px 8px;
    padding: 0 14px 12px;
  }
  .nav-item {
    min-height: 48px;
    padding: 9px 11px;
    font-size: 0.82rem;
  }
  .nav-item .icon {
    width: 18px;
    height: 18px;
  }
  .page-head {
    align-items: flex-start;
    flex-wrap: wrap;
    margin-bottom: 16px;
  }
  .page-head h1 {
    font-size: 1.55rem;
  }
  .page-head .desc {
    font-size: 0.85rem;
  }
  .hero {
    padding: 24px 22px;
    min-height: 175px;
  }
  .hero-copy {
    max-width: 78%;
  }
  .hero-art {
    right: -20px;
    top: 4px;
    width: 170px;
    height: 170px;
    opacity: 0.5;
  }
  .hero h2 {
    font-size: 1.35rem;
  }
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 12px 0;
  }
  .metric {
    padding: 15px;
  }
  .metric-number {
    font-size: 1.45rem;
    margin-top: 8px;
  }
  .dashboard-grid,
  .content-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .card-pad {
    padding: 18px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .photo-grid {
    gap: 10px;
  }
  .photo-meta {
    padding: 12px;
  }
  .photo-meta .btn {
    width: 100%;
  }
  .my-record {
    gap: 8px;
  }
  .my-record .metric {
    padding: 12px;
  }
  .my-record .metric-top {
    font-size: 0.75rem;
  }
  .my-record .metric-number {
    font-size: 1.3rem;
  }
  .login-card {
    padding: 30px 22px;
  }
  .login-brand img {
    margin-bottom: 25px;
  }
}
@media (max-width: 340px) {
  .brand-divider,
  .brand-name span {
    display: none;
  }
  .brand-name {
    font-size: 0.72rem;
  }
  .topbar-inner {
    padding: 0 9px;
  }
  .account {
    display: none;
  }
  .logout {
    font-size: 0.72rem;
  }
  .photo-grid {
    grid-template-columns: 1fr;
  }
  .my-record {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .hero-copy {
    max-width: 100%;
  }
  .hero-art {
    opacity: 0.2;
  }
  .metric-top {
    font-size: 0.76rem;
  }
  .profile-stats {
    gap: 14px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

.row-text strong span.inline {
  display: inline;
  color: var(--sub);
  margin: 0;
}

/* Controls and surfaces share the same proportions as the KSAIN interface. */
:root {
  --surface-soft: #f3f5f9;
  --line-strong: #cdd3df;
  --control-focus: #5b5fc7;
  --accent-teal: #267d7b;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.035);
}
:root.dark {
  --surface-soft: #202123;
  --line-strong: #55575d;
  --control-focus: #a5b4fc;
  --accent-teal: #8dd6cb;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
.card {
  border-radius: 15px;
}
.page-head {
  align-items: center;
  margin: 4px 0 24px;
}
.page-head h1 {
  letter-spacing: -0.045em;
}
.page-head p.desc {
  margin-top: 8px;
}
.btn {
  border-radius: 10px;
  letter-spacing: -0.015em;
}
.btn-primary {
  box-shadow: 0 2px 4px rgba(30, 27, 75, 0.12);
}
.btn-secondary {
  border-color: var(--line-strong);
}
.btn-danger-solid {
  background: #b83b48;
  color: white;
}
.btn-danger-solid:hover {
  background: #9f303d;
}
.icon-button {
  border-radius: 10px;
}
.login-page {
  background: var(--background);
}
.login-card {
  border-radius: 20px;
}
.login-brand img {
  margin-bottom: 24px;
}
.login-brand h1 {
  font-size: 1.75rem;
  letter-spacing: -0.045em;
}
.login-brand p {
  margin-top: 9px;
}
.hero {
  min-height: 174px;
  border-radius: 15px;
}
.hero:after {
  display: none;
}
.hero-kicker {
  color: #d2d6f5;
  font-size: 0.84rem;
  font-weight: 700;
}
.hero h2 {
  margin: 10px 0 8px;
}
.hero .hero-meta .dot {
  background: #7ed6bd;
}
.hero-art {
  opacity: 0.8;
}
.metrics {
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--card);
}
.metrics .metric {
  border: 0;
  border-right: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.metrics .metric:last-child {
  border-right: 0;
}
.metrics .metric-icon {
  color: var(--accent-teal);
  background: var(--surface-soft);
}
.rank-avatar,
.profile-icon,
.avatar {
  border-radius: 10px;
}
.tabs {
  background: var(--surface-soft);
  padding: 4px;
  border: 1px solid var(--border);
}
.tab {
  border-radius: 8px;
}
.tab.active {
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1);
}
.empty-symbol {
  border-radius: 12px;
}

.select-control {
  position: relative;
  min-width: 0;
}
.field select.select-native {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
  opacity: 0;
  pointer-events: none;
}
.select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 10px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
  text-align: left;
  line-height: 1.45;
  transition:
    border-color 0.16s,
    background 0.16s,
    box-shadow 0.16s;
}
.select-trigger:hover {
  border-color: var(--control-focus);
}
.select-trigger:focus-visible,
.select-control.is-open .select-trigger {
  outline: none;
  border-color: var(--control-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.16);
}
.select-trigger[aria-invalid="true"] {
  border-color: var(--danger);
}
.select-trigger.is-placeholder {
  color: var(--sub);
}
.select-value {
  min-width: 0;
  overflow-wrap: anywhere;
}
.select-chevron {
  width: 20px;
  height: 20px;
  flex: none;
  color: var(--sub);
  transition: transform 0.16s;
}
.select-control.is-open .select-chevron {
  transform: rotate(180deg);
}
.select-panel {
  position: absolute;
  top: calc(100% + 7px);
  left: 0;
  right: 0;
  z-index: 40;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  box-shadow:
    0 12px 32px rgba(15, 23, 42, 0.16),
    0 2px 7px rgba(15, 23, 42, 0.06);
}
.select-panel[hidden],
.select-option[hidden],
.select-no-results[hidden],
.select-error[hidden] {
  display: none;
}
.select-control.opens-up .select-panel {
  top: auto;
  bottom: calc(100% + 7px);
}
.select-options {
  max-height: min(264px, 38vh);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.select-option {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.4;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.select-option:hover,
.select-option.is-active {
  background: var(--muted);
}
.select-option[aria-selected="true"] {
  color: var(--primary-hover);
  font-weight: 700;
}
.dark .select-option[aria-selected="true"] {
  color: #d0d8ff;
}
.select-option[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
}
.select-check {
  width: 18px;
  height: 18px;
  flex: none;
  visibility: hidden;
}
.select-check svg {
  width: 100%;
  height: 100%;
}
.select-option[aria-selected="true"] .select-check {
  visibility: visible;
}
.select-search-wrap {
  padding: 3px 3px 7px;
}
.field .select-search {
  min-height: 44px;
  padding: 9px 12px;
  background: var(--surface-soft);
}
.select-no-results {
  padding: 14px;
  color: var(--sub);
  font-size: 0.86rem;
}
.select-error {
  display: block;
  margin-top: 6px;
  color: var(--danger);
  font-size: 0.85rem;
}

.file-picker {
  position: relative;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--card);
}
.file-picker:focus-within {
  outline: 3px solid rgba(99, 102, 241, 0.2);
  border-color: var(--control-focus);
}
.file-picker-action {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 6px 11px;
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
}
.file-picker-action .icon {
  width: 17px;
  height: 17px;
}
.file-picker-name {
  min-width: 0;
  color: var(--sub);
  font-size: 0.84rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.field .file-picker input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
}

.decision-dialog {
  width: min(440px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--card);
  color: var(--text);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.25);
}
.decision-dialog::backdrop {
  background: rgba(15, 23, 42, 0.52);
}
.decision-card {
  padding: 24px;
}
.decision-header {
  display: flex;
  align-items: center;
  gap: 12px;
}
.decision-header h2 {
  font-size: 1.12rem;
}
.decision-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 12px;
  color: var(--primary-hover);
  background: var(--brand-soft);
}
.dark .decision-icon {
  color: #d0d8ff;
}
.decision-message {
  margin-top: 15px;
  color: var(--sub);
  font-size: 0.92rem;
  line-height: 1.6;
  word-break: keep-all;
}
.decision-reason {
  margin-top: 18px;
}
.decision-reason textarea {
  min-height: 82px;
  resize: vertical;
}
.decision-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 23px;
}
@media (max-width: 620px) {
  .metrics .metric:nth-child(2) {
    border-right: 0;
  }
  .metrics .metric:nth-child(-n + 2) {
    border-bottom: 1px solid var(--border);
  }
  .page-head {
    align-items: flex-start;
  }
  .hero {
    min-height: 162px;
  }
}
@media (max-width: 340px) {
  .decision-actions .btn {
    flex: 1 1 100%;
  }
  .decision-card {
    padding: 20px;
  }
}
.time-field {
  display: flex;
  gap: 8px;
  min-width: 0;
}
.field .time-field input {
  flex: 1 1 0;
  min-width: 0;
}
.time-now {
  min-width: 48px;
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--text);
  background: var(--surface-soft);
  font-size: 0.83rem;
  font-weight: 700;
  white-space: nowrap;
}
.time-now:hover {
  border-color: var(--control-focus);
}
.file-picker.is-invalid {
  border-color: var(--danger);
}
.file-error {
  margin-top: 0;
}
.file-error[hidden] {
  display: none;
}
.btn[aria-busy="true"] {
  cursor: progress;
}
.button-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: button-spin 0.7s linear infinite;
}
@keyframes button-spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .button-spinner {
    animation-duration: 1.6s;
  }
}
.time-picker-trigger {
  display: flex;
  flex: 1 1 0;
  min-width: 0;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--card);
  color: var(--sub);
  text-align: left;
  line-height: 1.4;
}
.time-picker-trigger.has-value {
  color: var(--text);
}
.time-picker-trigger:hover {
  border-color: var(--control-focus);
}
.time-picker-trigger span {
  overflow-wrap: anywhere;
}
.date-time-dialog {
  width: min(420px, calc(100vw - 28px));
  max-width: none;
  max-height: calc(100dvh - 28px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--card);
  color: var(--text);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.25);
}
.date-time-dialog::backdrop {
  background: rgba(15, 23, 42, 0.52);
}
.date-time-card {
  padding: 22px;
}
.picker-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.picker-heading h2 {
  font-size: 1.2rem;
  margin-top: 2px;
}
.picker-step {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--sub);
}
.picker-close,
.calendar-arrow {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 10px;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--sub);
}
.picker-close:hover,
.calendar-arrow:hover {
  background: var(--muted);
  color: var(--text);
}
.picker-help {
  color: var(--sub);
  font-size: 0.88rem;
  margin: 10px 0 14px;
}
.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 0 8px;
}
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
}
.calendar-weekdays {
  color: var(--sub);
  text-align: center;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.calendar-weekdays span {
  padding: 7px 0;
}
.calendar-day {
  min-height: 42px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
}
.calendar-day:hover {
  background: var(--muted);
}
.calendar-day.today:not(.selected) {
  color: var(--primary-hover);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.dark .calendar-day.today:not(.selected) {
  color: #c7d2fe;
}
.calendar-day.selected {
  color: #fff;
  background: var(--primary);
}
.picker-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 18px;
}
.picker-text {
  min-height: 44px;
  padding: 8px 2px;
  color: var(--sub);
  font-size: 0.85rem;
  font-weight: 700;
}
.picker-text:hover {
  color: var(--text);
}
.clock-readout {
  display: flex;
  justify-content: center;
  align-items: end;
  gap: 8px;
  margin: 10px 0 12px;
}
.clock-input {
  display: grid;
  gap: 4px;
  text-align: center;
}
.clock-input label {
  color: var(--sub);
  font-size: 0.75rem;
  font-weight: 700;
}
.clock-input input {
  width: 84px;
  min-height: 48px;
  padding: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--text);
  font: inherit;
  font-size: 1.35rem;
  font-weight: 700;
  text-align: center;
  appearance: textfield;
}
.clock-input input::-webkit-inner-spin-button,
.clock-input input::-webkit-outer-spin-button {
  appearance: none;
  margin: 0;
}
.clock-colon {
  padding-bottom: 7px;
  font-size: 1.5rem;
  font-weight: 700;
}
.clock-switch,
.clock-period {
  display: flex;
  justify-content: center;
  gap: 6px;
}
.clock-switch button,
.clock-period button {
  min-height: 38px;
  min-width: 68px;
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--sub);
  font-size: 0.82rem;
  font-weight: 700;
}
.clock-switch button[aria-pressed="true"],
.clock-period button[aria-pressed="true"] {
  background: var(--brand-soft);
  color: var(--text);
}
.clock-period {
  margin-top: 3px;
}
.clock-face {
  position: relative;
  width: 210px;
  height: 210px;
  margin: 8px auto 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface-soft);
}
.clock-number {
  position: absolute;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  font-size: 0.85rem;
  font-weight: 700;
}
.clock-number:hover {
  background: var(--muted);
}
.clock-number.selected {
  color: #fff;
  background: var(--primary);
}
.clock-number:nth-child(1) {
  left: 72%;
  top: 12%;
}
.clock-number:nth-child(2) {
  left: 88%;
  top: 28%;
}
.clock-number:nth-child(3) {
  left: 94%;
  top: 50%;
}
.clock-number:nth-child(4) {
  left: 88%;
  top: 72%;
}
.clock-number:nth-child(5) {
  left: 72%;
  top: 88%;
}
.clock-number:nth-child(6) {
  left: 50%;
  top: 94%;
}
.clock-number:nth-child(7) {
  left: 28%;
  top: 88%;
}
.clock-number:nth-child(8) {
  left: 12%;
  top: 72%;
}
.clock-number:nth-child(9) {
  left: 6%;
  top: 50%;
}
.clock-number:nth-child(10) {
  left: 12%;
  top: 28%;
}
.clock-number:nth-child(11) {
  left: 28%;
  top: 12%;
}
.clock-number:nth-child(12) {
  left: 50%;
  top: 6%;
}
.clock-center {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 7px;
  height: 7px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--line-strong);
}
.clock-help {
  color: var(--sub);
  font-size: 0.78rem;
  text-align: center;
  margin-top: 10px;
}
@media (max-width: 340px) {
  .date-time-card {
    padding: 16px;
  }
  .calendar-day {
    min-height: 38px;
  }
  .clock-face {
    width: 190px;
    height: 190px;
  }
}
.clock-face.is-minute .clock-number:nth-child(1) {
  left: 50%;
  top: 6%;
}
.clock-face.is-minute .clock-number:nth-child(2) {
  left: 72%;
  top: 12%;
}
.clock-face.is-minute .clock-number:nth-child(3) {
  left: 88%;
  top: 28%;
}
.clock-face.is-minute .clock-number:nth-child(4) {
  left: 94%;
  top: 50%;
}
.clock-face.is-minute .clock-number:nth-child(5) {
  left: 88%;
  top: 72%;
}
.clock-face.is-minute .clock-number:nth-child(6) {
  left: 72%;
  top: 88%;
}
.clock-face.is-minute .clock-number:nth-child(7) {
  left: 50%;
  top: 94%;
}
.clock-face.is-minute .clock-number:nth-child(8) {
  left: 28%;
  top: 88%;
}
.clock-face.is-minute .clock-number:nth-child(9) {
  left: 12%;
  top: 72%;
}
.clock-face.is-minute .clock-number:nth-child(10) {
  left: 6%;
  top: 50%;
}
.clock-face.is-minute .clock-number:nth-child(11) {
  left: 12%;
  top: 28%;
}
.clock-face.is-minute .clock-number:nth-child(12) {
  left: 28%;
  top: 12%;
}

/* Account photo and clock picker */
.avatar { position: relative; overflow: hidden; flex: 0 0 auto; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar img[hidden] { display: none; }
.avatar .icon { width: 18px; height: 18px; }
.clock-display { display: flex; align-items: center; justify-content: center; gap: 24px; min-height: 115px; margin: 16px 0 18px; padding: 14px; border-radius: 14px; background: var(--primary); color: #fff; }
.clock-period { display: grid; gap: 2px; margin: 0; }
.clock-period button { min-width: 44px; min-height: 36px; padding: 4px; color: rgba(255,255,255,.55); font-size: .88rem; }
.clock-period button[aria-pressed="true"] { color: #fff; background: transparent; }
.clock-readout { align-items: center; gap: 1px; margin: 0; font-variant-numeric: tabular-nums; }
.clock-readout button, .clock-readout input, .clock-colon { padding: 0; border: 0; background: transparent; color: rgba(255,255,255,.55); font: inherit; font-size: 3.65rem; font-weight: 600; line-height: 1; }
.clock-readout button { min-width: 64px; }
.clock-readout button[aria-pressed="true"] { color: #fff; }
.clock-readout input { width: 72px; color: #fff; text-align: center; appearance: textfield; }
.clock-readout input::-webkit-inner-spin-button, .clock-readout input::-webkit-outer-spin-button { appearance: none; margin: 0; }
.clock-readout :is(button, input):focus-visible, .clock-period button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; border-radius: 4px; }
.clock-face { width: 230px; height: 230px; margin: 12px auto 0; border: 0; }
.clock-number { z-index: 1; font-size: .9rem; }
.clock-hand { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; stroke: var(--primary); stroke-width: 1.5; fill: var(--primary); }
.clock-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; }
.clock-actions .picker-text { font-size: .78rem; }
@media (max-width: 340px) {
  .clock-display { gap: 12px; }
  .clock-readout button, .clock-readout input, .clock-colon { font-size: 3rem; }
  .clock-readout button { min-width: 54px; }
  .clock-readout input { width: 58px; }
  .clock-face { width: 200px; height: 200px; }
}
:root.dark .clock-number.selected { background: #647bce; }
:root.dark .clock-hand { stroke: #647bce; fill: #647bce; }
@media (max-width: 340px) { .account { display: flex; } }

.login-modes { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--border); border-radius: 11px; background: var(--muted); }
.login-modes button { flex: 1; min-width: 0; min-height: 42px; border-radius: 8px; color: var(--sub); font-size: .86rem; font-weight: 700; }
.login-modes button[aria-pressed="true"] { color: var(--text); background: var(--card); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.login-modes button:focus-visible { outline: 2px solid var(--primary-hover); outline-offset: 2px; }
.login-modes[hidden], .login-server-notice[hidden] { display: none; }
.login-server-notice { margin: 0; }
@media (max-width: 340px) { .login-modes button { font-size: .75rem; line-height: 1.25; } }
.clock-face { touch-action: none; cursor: grab; user-select: none; }
.clock-face:active { cursor: grabbing; }
.clock-readout button:disabled { opacity: .55; cursor: default; }
