:root {
  --sidebar: #0e5131;
  --nav-active: #16a34a;
  --bg: #f3f4f6;
  --card: #ffffff;
  --line: #e5e7eb;
  --text: #0f172a;
  --muted: #64748b;
  --green: #16a34a;
  --green-dark: #0e5131;
  --green-soft: #dcfce7;
  --gold: #c8962e;
  --danger: #b42318;
  --shadow: 0 10px 28px rgba(18, 52, 36, .06);
  --font: "Prompt", "Leelawadee UI", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
}
button, input, select, textarea { font: inherit; color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--nav-active); outline-offset: 2px; }
::selection { background: #c8ecd4; }

.icon { width: 18px; height: 18px; flex: none; }
.icon-team {
  width: 22px;
  height: 22px;
  object-fit: contain;
}
.menu .icon-team, .section-head h2 .icon-team, .stat-icon .icon-team { filter: invert(1); }
.noscript { padding: 24px; }

.app { display: flex; min-height: 100vh; align-items: stretch; }
.sidebar {
  width: 252px;
  flex: none;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 18px 12px 16px;
  color: white;
  background:
    radial-gradient(circle at 10% 115%, rgba(143, 209, 106, .28), transparent 46%),
    linear-gradient(180deg, #14503c 0%, #0d3328 55%, #0b2b22 100%);
  overflow: hidden;
}
.brand, .login-brand {
  position: relative;
  z-index: 2;
  display: block;
  color: white;
  text-decoration: none;
}
.brand-logo {
  display: block;
  width: 100%;
  height: auto;
}
.login-brand .brand-logo { width: min(280px, 100%); }
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: #edfff4;
  color: #0e3a2c;
  font-size: 13px;
  font-weight: 700;
}
.nav { display: flex; flex-direction: column; gap: 4px; margin-top: 22px; position: relative; z-index: 2; }
.nav-label {
  margin: 16px 12px 2px;
  color: rgba(255, 255, 255, .55);
  font-size: 12px;
  font-weight: 600;
}
.nav a, .menu a, .menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  text-decoration: none;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, .84);
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 500;
  cursor: pointer;
}
.nav a[aria-current="page"] { background: var(--nav-active); color: white; }
.nav a:hover { background: rgba(255, 255, 255, .08); }
.nav a[aria-current="page"]:hover { background: #1b8a4c; }
.sidebar-foot {
  margin-top: auto;
  position: relative;
  z-index: 1;
  padding: 12px 14px 18px;
}
.sidebar-leaves {
  position: absolute;
  left: 50%;
  bottom: calc(100% - 13px);
  width: 196px;
  height: auto;
  translate: calc(-50% - 0.2cm) 1cm;
  rotate: 10deg;
  z-index: 0;
  pointer-events: none;
  user-select: none;
}
.sidebar-foot strong {
  position: relative;
  z-index: 1;
  font-size: 28px;
  line-height: 1.05;
}

.workspace { flex: 1; min-width: 0; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 22px;
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.topbar-left, .top-actions, .top-tools, .crumbs { display: flex; align-items: center; gap: 8px; min-width: 0; }
.crumbs { color: #7d8d85; font-size: 13px; }
.crumbs a { color: inherit; text-decoration: none; }
.icon-btn, .avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
}
.icon-btn {
  position: relative;
  border: 1px solid var(--line);
  background: white;
  color: #245140;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.top-tools .icon-btn:hover {
  background: #e8f7ee;
  border-color: #b7d7c4;
  color: #0e5131;
}
.top-tools .icon-btn:active { background: #d7f0e1; }
.mobile-brand, .dock, .dock-label { display: none; }
.menu-btn { display: none; }
.icon-btn.menu-btn { display: none; }
.dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e23d3d;
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
}
.avatar { background: var(--nav-active); color: white; font-weight: 700; border-radius: 50%; }
.avatar.lg { width: 52px; height: 52px; border-radius: 16px; font-size: 18px; }
.who { display: grid; text-align: left; }
.who strong, .stat-profile strong { font-size: 14px; }
.who small, .stat small, .hero-note small, .muted, .score-row small, .user-row small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}
.menu-root { position: relative; }
.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 280px;
  padding: 8px;
  background: white;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(16, 40, 28, .14);
  z-index: 30;
}
.menu a, .menu button { color: var(--text); border-radius: 8px; }
.menu a:hover, .menu button:hover { background: #f3faf5; }
.menu-empty, .menu-note { padding: 8px 10px; color: var(--muted); font-size: 13px; }
.note-go { display: none; }
.backdrop { display: none; }

.content { padding: 18px 22px 48px; display: flex; flex-direction: column; gap: 14px; }
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 16px;
  align-items: center;
  min-height: 240px;
  padding: 18px;
  border-radius: 22px;
  overflow: hidden;
  background: #d7efc4;
}
.hero-bg { position: absolute; inset: 0; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; object-position: 68% 70%; display: block; }
.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, .86) 0%, rgba(255, 255, 255, .42) 34%, rgba(255, 255, 255, 0) 58%);
}
.hero-bg svg { width: 100%; height: 100%; display: block; }
.hero-orb, .hero-copy, .hero-side { position: relative; z-index: 1; min-width: 0; }
.hero-orb { width: 180px; height: 180px; }
.hero-orb svg, .login-orb svg { width: 100%; height: 100%; }
.hero-copy h1, .login-hero h1 { margin: 0; color: #12753c; font-size: 34px; line-height: 1.1; }
.hero-copy h2, .login-hero h2 { margin: 4px 0 8px; font-size: 22px; }
.hero-copy p { margin: 0; color: #3d5c4c; line-height: 1.55; }
.hero-side { display: flex; flex-direction: column; gap: 10px; }
.hero-note, .stat, .panel, .activity-card, .score-hero div, .login-card {
  background: white;
  border: 1px solid rgba(20, 70, 45, .06);
  box-shadow: var(--shadow);
}
.hero-note { display: flex; gap: 10px; align-items: flex-start; border-radius: 16px; padding: 12px; }
.hero-note strong { display: block; font-size: 14px; line-height: 1.45; }
.stat-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex: none;
}
.stat-icon.green { background: var(--green-soft); color: var(--green); }
.stat-icon.gold { background: #fff4df; color: var(--gold); }

.stats, .stats-5, .stats-3 { display: grid; gap: 12px; }
.stats { grid-template-columns: minmax(240px, 1fr) minmax(0, 1.35fr); align-items: stretch; }
.metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.metric-grid .metric:last-child:nth-child(odd) { grid-column: 1 / -1; }
.metric {
  position: relative;
  overflow: hidden;
  min-height: 118px;
  padding: 14px 56px 16px 16px;
  border-radius: 18px;
  background: white;
  border: 1px solid rgba(20, 70, 45, .06);
  box-shadow: var(--shadow);
}
.metric small { display: block; color: #64748b; font-size: 13px; font-weight: 600; }
.metric b {
  display: block;
  margin: 8px 0 6px;
  font-size: 34px;
  line-height: 1;
  letter-spacing: -.04em;
  color: #111827;
}
.metric b.metric-title {
  font-size: 16px;
  line-height: 1.35;
  letter-spacing: 0;
  margin: 10px 0 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.metric em { display: block; color: #94a3b8; font-style: normal; font-size: 12px; font-weight: 500; }
.metric-mark {
  position: absolute;
  right: 4px;
  bottom: 2px;
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.metric-mark .icon { width: 62px; height: 62px; stroke-width: 1.3; }
.metric.gold .metric-mark { color: #f0c36a; opacity: .45; }
.metric.green .metric-mark { color: #86d3a4; opacity: .55; }
.metric .icon-team {
  width: 58px;
  height: 58px;
  filter: brightness(0) saturate(100%) invert(76%) sepia(18%) saturate(638%) hue-rotate(84deg) brightness(96%) contrast(88%);
  opacity: .7;
}
.stats-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stats-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat { display: flex; gap: 12px; align-items: center; min-height: 96px; padding: 14px 16px; border-radius: 18px; }
.stat b, .score-hero b { font-size: 28px; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.stat b span { font-size: 13px; font-weight: 600; color: var(--muted); margin-left: 2px; }
.stat-profile { align-items: center; }
.stat-profile strong, .stat-profile small { display: block; }
.stat-profile small { margin: 2px 0 6px; }
.rank { color: #146b38; }

.section-head { display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.section-head h2, .panel h2, .page-intro h1, .detail-visual h1 { margin: 0; }
.section-head h2 { display: flex; align-items: center; gap: 8px; font-size: 18px; }
.hint { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--muted); font-size: 13px; text-align: right; }
.cards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.activity-card { display: flex; flex-direction: column; border-radius: 16px; padding: 12px; min-width: 0; transition: transform .15s ease, box-shadow .15s ease; }
.activity-card:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(18, 52, 36, .1); }
.card-media { position: relative; height: 132px; border-radius: 12px; overflow: hidden; }
.card-media.tall { height: 210px; }
.card-media svg, .card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-no {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #0e5131;
  color: white;
  font-size: 13px;
  font-weight: 700;
}
.title-row { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; margin: 10px 0 6px; }
.activity-card h3, .detail-visual h1 { margin: 0; font-size: 15px; line-height: 1.35; flex: 1; }
.detail-visual h1 { font-size: 24px; }
.activity-card p { margin: 0 0 10px; color: var(--muted); font-size: 12.5px; line-height: 1.45; min-height: 2.9em; }
.activity-card .pill { align-self: flex-start; margin-bottom: 12px; }
.activity-card .btn { margin-top: auto; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.pill .icon { width: 14px; height: 14px; }
.pill-ok { background: #e5f7ea; color: #157a3e; }
.pill-muted { background: #f2f4f3; color: #7b8a83; }
.pill-points { background: var(--green-soft); color: #17803f; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.btn .icon { width: 16px; height: 16px; }
.btn-primary { background: #0e5131; color: white; }
.btn-done { background: var(--nav-active); color: white; }
.btn-ghost { background: white; color: var(--green-dark); border: 1px solid #cfe0d6; }
.btn-danger { background: #fff1f0; color: var(--danger); }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 10px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 600; }
.back .icon { transform: rotate(180deg); }

.panel, .page-intro { }
.panel { border-radius: 18px; padding: 16px 18px 18px; }
.panel h2 { margin-bottom: 10px; font-size: 18px; }
.page-intro h1 { font-size: 28px; }
.page-intro p { margin: 6px 0 0; color: var(--muted); }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.add-fab {
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: #0e5131;
  color: white;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: none;
}
.add-fab .icon { width: 22px; height: 22px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.bar { height: 8px; border-radius: 99px; background: #e5f0e9; overflow: hidden; margin: 10px 0 14px; }
.bar span { display: block; height: 100%; background: var(--nav-active); }
.recent-list { display: flex; flex-direction: column; }
.recent-row, .score-row, .user-row {
  display: grid;
  gap: 8px 12px;
  align-items: center;
  text-decoration: none;
  color: inherit;
}
.recent-row { grid-template-columns: max-content minmax(0, 1fr) auto; padding: 10px 0; border-top: 1px solid var(--line); font-size: 15px; }
.recent-row > * { white-space: nowrap; }
.recent-row strong { overflow: hidden; text-overflow: ellipsis; }
.score-hero { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.score-hero div { border-radius: 18px; padding: 18px; }
.score-hero small { color: var(--muted); }
.score-list { display: flex; flex-direction: column; gap: 14px; }
.score-row { grid-template-columns: 1fr auto; }
.score-row .bar { grid-column: 1 / -1; margin: 0; }
.detail { display: grid; grid-template-columns: .9fr 1.1fr; gap: 20px; align-items: start; }
.field, .filters { display: grid; gap: 6px; }
.field { font-size: 13px; font-weight: 600; color: #245140; }
.submit-form { display: flex; flex-direction: column; gap: 18px; }
.submit-form .field { gap: 8px; }
.submit-form .confirm { margin-top: 2px; line-height: 1.5; }
.submit-form .btn { margin-top: 2px; min-height: 44px; }
.filters { grid-template-columns: repeat(4, minmax(140px, 1fr)) auto auto; align-items: end; margin-bottom: 12px; }
input:not([type]), input[type="text"], input[type="password"], input[type="number"], input[type="date"], select, textarea {
  width: 100%;
  border: 1px solid #d5e4db;
  border-radius: 12px;
  padding: 12px 14px;
  background: white;
  font-weight: 500;
}
.submit-form input[type="text"],
.submit-form input[type="number"],
.submit-form input[type="date"],
.submit-form textarea { min-height: 46px; }
.date-lock {
  pointer-events: none;
  background: #f3faf5;
  color: #245140;
}
textarea { min-height: 104px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #a8b6af; font-weight: 400; opacity: 1; }
.field small { font-weight: 500; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice, .confirm { display: flex; gap: 8px; align-items: center; font-weight: 600; color: var(--text); }
.choice { border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; }
fieldset.field { border: 0; padding: 0; margin: 0; }
.callout { border-radius: 12px; padding: 10px 12px; background: #f3faf5; border: 1px solid #d7eedf; color: #1d6840; font-size: 13px; margin-bottom: 12px; }
.callout.warn { background: #fff6f5; border-color: #ffd9d4; color: #9f2c20; }
.evidence-line { margin: 12px 0 0; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; }
tr.me { background: #eef8f1; }
tr.rank-1 { box-shadow: inset 3px 0 #e0b44f; }
.void { color: var(--muted); text-decoration: line-through; }
.filter-field { max-width: 320px; margin-bottom: 12px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.add-grid, .edit-grid {
  display: grid;
  grid-template-columns: 1.1fr 1.4fr .45fr auto;
  gap: 10px;
  align-items: end;
}
.add-grid h2, .span-all { grid-column: 1 / -1; }
.edit-actions { display: flex; gap: 10px; align-items: center; }
.user-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.user-card {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 58px;
  margin: 0;
  padding: 4px 12px 4px 4px;
  border: 1px solid #d5e4db;
  border-radius: 999px;
  background: white;
  box-shadow: var(--shadow);
  text-align: left;
  cursor: pointer;
}
.user-card.selected { border-color: #0e5131; box-shadow: 0 0 0 2px #0e5131; }
.user-card.is-off { opacity: .55; }
.user-card > .avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 15px;
  flex: none;
}
.user-card-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.user-card-copy strong {
  font-size: 15px;
  line-height: 1.2;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-card-copy small {
  color: #5d7268;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
}
.user-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(15, 23, 42, .45);
  cursor: pointer;
}
.user-modal-card {
  position: relative;
  width: min(420px, 100%);
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 18px 16px;
  border-radius: 24px;
  background: white;
  box-shadow: 0 24px 60px rgba(16, 40, 28, .25);
  max-height: calc(100vh - 40px);
  overflow: auto;
}
.user-modal-card.profile-card { width: min(520px, 100%); }
.user-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: #eef3f0;
  color: #245140;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.user-modal-head { display: flex; align-items: center; gap: 12px; padding-right: 36px; }
.user-modal-head .avatar { width: 56px; height: 56px; font-size: 18px; flex: none; }
.user-modal-head strong { display: block; font-size: 20px; line-height: 1.2; }
.user-modal-head small { color: #5d7268; font-size: 13px; font-weight: 500; }
.user-modal-actions { display: flex; justify-content: space-between; gap: 10px; }
.user-row {
  grid-template-columns: 1.3fr 1fr .8fr auto auto;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.user-row:last-child { border-bottom: 0; }
.branch-stack {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}
.branch-stack > .attach-empty { grid-column: 1 / -1; }
.branch-block { border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px 8px; background: #f8fbf9; min-width: 0; }
.branch-block .settings-add { flex-wrap: wrap; }
.dept-nest { margin: 8px 0 4px 8px; padding-left: 14px; border-left: 3px solid #b7d7c4; }
.dept-nest h3, .loose-depts h3 { margin: 0 0 8px; font-size: 14px; color: #245140; }
.loose-depts { margin-top: 16px; }
.branch-picks { display: flex; flex-wrap: wrap; gap: 8px; }
.branch-pick {
  border: 1px solid #cfe0d6;
  background: white;
  color: #0e5131;
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 600;
  cursor: pointer;
}
.branch-pick.selected { background: #0e5131; color: white; border-color: #0e5131; }
.sport-other { margin-top: 10px; }
.settings-add { display: flex; gap: 8px; align-items: end; margin-bottom: 8px; }
.settings-add .field { flex: 1; }
.org-list { display: flex; flex-direction: column; }
.org-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.org-actions { display: flex; gap: 8px; justify-content: flex-end; }
.org-row-move { grid-template-columns: minmax(0, 1fr) minmax(140px, .8fr) auto; }
.org-row:last-child { border-bottom: 0; }
.org-row input { min-width: 0; }

.login-screen { min-height: 100vh; display: grid; grid-template-columns: 1.1fr .9fr; }
.login-hero {
  position: relative;
  overflow: hidden;
  padding: 48px;
  color: #1d3b2c;
  background: #d7efc4;
}
.login-hero > * { position: relative; z-index: 1; }
.login-copy {
  width: min(520px, 100%);
  padding: 22px 22px 8px;
  border-radius: 20px;
  background: rgba(255, 255, 255, .84);
}
.login-banner {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 68% 70%;
}
.login-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, .9) 0%, rgba(255, 255, 255, .55) 42%, rgba(255, 255, 255, .08) 100%);
}
.login-hero h1, .login-hero h2 { color: #12753c; }
.login-hero p, .login-hero li { color: #1d3b2c; }
.login-hero p { max-width: 460px; line-height: 1.6; }
.login-hero ul { padding-left: 18px; line-height: 1.8; }
.login-brand { margin-bottom: 28px; }
.login-orb { position: absolute; right: 24px; bottom: 12px; width: 220px; opacity: .95; }
.login-panel { display: grid; place-items: center; padding: 32px 20px; overflow: auto; }
.login-card { width: min(440px, 100%); border-radius: 20px; padding: 28px; display: grid; gap: 12px; }
.register-card { width: min(560px, 100%); }
.register-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.register-grid .span-2 { grid-column: 1 / -1; }
.photo-preview { width: 72px; height: 72px; object-fit: cover; border-radius: 16px; margin-top: 8px; }
.file-picker {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-self: start;
  width: fit-content;
  max-width: 100%;
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid #cfe0d6;
  border-radius: 999px;
  background: white;
  color: #0e5131;
  font-weight: 600;
  cursor: pointer;
}
.file-picker input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  padding: 0;
  border: 0;
  background: transparent;
}
.file-name {
  color: #0e5131;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-picker:has(.file-name.ready) {
  background: #0e5131;
  border-color: #0e5131;
  color: white;
}
.file-picker:has(.file-name.ready) .file-name { color: white; }
.photo-frame { position: relative; }
.photo-clear {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: rgba(15, 23, 42, .78);
  color: white;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.photo-clear:hover { background: #9f2c20; }
.activity-photo {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 12px;
  background: #f4f7f5;
}
.attach-empty { color: var(--muted); font-weight: 500; }
.photo-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; display: block; }
.avatar { overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.login-card h1 { margin: 0; font-size: 28px; }
.login-card p { margin: 0; color: var(--muted); }
.auth-switch { text-align: center; font-size: 14px; }
.auth-switch a { color: #0e5131; font-weight: 700; text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  max-width: min(360px, calc(100vw - 32px));
  padding: 12px 14px;
  border-radius: 12px;
  background: #14382c;
  color: white;
  box-shadow: 0 12px 30px rgba(16, 40, 28, .2);
}
.toast.error { background: #8f1d1d; }

@media (max-width: 1280px) {
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stats-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stats { grid-template-columns: 1fr; }
  .stat-profile { grid-column: 1 / -1; }
}
@media (max-width: 1100px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero-side { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; }
  .hero-bg::after { background: linear-gradient(180deg, rgba(255, 255, 255, .82) 0%, rgba(255, 255, 255, .2) 48%, rgba(255, 255, 255, 0) 100%); }
  .hero-orb { display: none; }
  .sidebar, .backdrop, .menu-btn, .icon-btn.menu-btn, .top-tools { display: none; }
  .topbar { height: 52px; }
  .topbar-left { flex: 1; }
  .top-actions { flex: none; }
  .crumbs { display: none; }
  .mobile-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    color: #0e5131;
    text-decoration: none;
  }
  .mobile-brand img {
    width: 36px;
    height: 36px;
    object-fit: cover;
    border-radius: 8px;
    flex: none;
  }
  .mobile-brand strong { font-size: 15px; white-space: nowrap; }
  .dock {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 32;
    align-items: stretch;
    background: white;
    border-top: 1px solid var(--line);
    box-shadow: 0 -8px 24px rgba(16, 40, 28, .06);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .dock-scroll, .dock-tools { display: flex; min-width: 0; }
  .dock-scroll { flex: 1; min-width: 0; overflow: hidden; }
  .dock-scroll::-webkit-scrollbar { display: none; }
  .dock-tools { flex: none; background: transparent; position: relative; z-index: 1; }
  .dock a, .dock .icon-btn {
    flex: 0 0 64px;
    width: 64px;
    min-height: 64px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    margin: 0;
    padding: 6px 4px 8px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #245140;
    text-decoration: none;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.15;
    text-align: center;
    cursor: pointer;
    scroll-snap-align: start;
  }
  .dock-scroll a { flex: 1 1 0; width: auto; min-width: 0; }
  .dock a span, .dock .dock-label {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 64px;
  }
  .dock .icon { width: 20px; height: 20px; }
  .dock .icon-team {
    filter: brightness(0) saturate(100%) invert(46%) sepia(78%) saturate(547%) hue-rotate(93deg) brightness(96%) contrast(89%);
  }
  .dock .dot { top: 6px; right: 16px; }
  .dock a[aria-current="page"], .dock .icon-btn.is-current { background: #e8f7ee; color: #0e5131; }
  .dock .icon-btn:hover,
  .dock .icon-btn.is-current:hover { background: #d7f0e1; color: #0e5131; }
  .dock .icon-btn:active { background: #c8e8d4; }
  .dock .menu a {
    flex-direction: row;
    width: 100%;
    min-height: 0;
    justify-content: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    font-size: 14px;
    text-align: left;
  }
  .dock .menu a span { display: inline; max-width: none; overflow: visible; -webkit-line-clamp: unset; }
  .dock .menu a[aria-current="page"] { background: #e8f7ee; color: #0e5131; }
  .dock .menu {
    position: fixed;
    left: 12px;
    right: 12px;
    top: auto;
    bottom: calc(72px + env(safe-area-inset-bottom));
    width: auto;
  }
  .dock .menu.menu-notes {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
  }
  .dock .menu.menu-notes a {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: none;
    width: 100%;
    overflow: hidden;
    line-height: 1.35;
    padding: 8px 10px 8px 12px;
  }
  .dock .menu.menu-notes a .note-text {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .dock .menu.menu-notes a .note-go {
    display: flex;
    flex: none;
    margin-left: auto;
    color: #16a34a;
  }
  .dock .menu.menu-notes a .note-go .icon { width: 16px; height: 16px; transform: scaleX(-1); }
  .dock .menu.menu-notes .menu-empty { flex: 1 0 auto; }
  .content { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .toast { right: 12px; bottom: calc(84px + env(safe-area-inset-bottom)); }
  .who small, .who strong { max-width: 34vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .split, .detail, .login-screen, .score-hero, .stats-3, .register-grid, .settings-grid { grid-template-columns: 1fr; }
  .register-grid .span-2 { grid-column: auto; }
  .filters, .add-grid, .edit-grid, .user-row, .branch-stack, .org-row, .org-row-move { grid-template-columns: 1fr; }
  .user-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .cards, .hero-side, .user-list { grid-template-columns: 1fr; }
  .content, .topbar { padding-left: 14px; padding-right: 14px; }
  .section-head { flex-direction: column; align-items: flex-start; }
  .hint { text-align: left; }
  .hero-copy h1 { font-size: 28px; }
  .login-hero { padding: 28px 20px 32px; }
  .login-hero::after { background: linear-gradient(180deg, rgba(255, 255, 255, .92) 0%, rgba(255, 255, 255, .84) 46%, rgba(255, 255, 255, .28) 78%, rgba(255, 255, 255, 0) 100%); }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
