:root {
  color: #1c1c1c;
  background: #f3f4f6;
  font-family: "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  font-size: 16px;
  line-height: 1.45;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body { margin: 0; }

button, input, select, textarea, a { font: inherit; }

h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 700; letter-spacing: -0.02em; }
h1 { font-size: 24px; line-height: 1.3; }
h2 { font-size: 18px; }
h3 { font-size: 16px; }

button, .button {
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  padding: 8px 12px;
  background: #e5e7eb;
  color: #1c1c1c;
  cursor: pointer;
}

a.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

button.primary { background: #0b57d0; color: white; font-weight: 700; }
button.danger { background: white; color: #b42318; border: 1px solid #fecdca; }
button:disabled { opacity: 0.45; cursor: default; }

input, select, textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid #d0d5dd;
  border-radius: 10px;
  padding: 8px 12px;
  background: white;
  color: #1c1c1c;
  font-size: 16px;
  font-weight: 400;
}

input::placeholder, textarea::placeholder { color: #98a2b3; }

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #344054;
  font-size: 14px;
  font-weight: 600;
}

button:focus-visible, .button:focus-visible, a:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid #0b57d0;
  outline-offset: 2px;
}

textarea { min-height: 72px; resize: vertical; }

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: calc(12px + env(safe-area-inset-top)) 24px 12px;
  background: white;
  border-bottom: 1px solid #e5e7eb;
}

.top a { color: inherit; font-weight: 700; text-decoration: none; }
.top-actions { display: flex; gap: 12px; align-items: center; }
.top-actions a {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  background: #f2f4f7;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
}
.top button { min-height: 36px; padding: 6px 12px; background: #f2f4f7; }

#app { max-width: 1100px; margin: 0 auto; padding: 24px 16px 48px; }

.stack { display: flex; flex-direction: column; gap: 12px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 6px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
}
.tabs a { background: transparent; color: #344054; font-weight: 700; }
.tabs a[aria-current="page"] { background: #0b57d0; color: white; }

.card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
}

.card .card { background: #f8fafc; }

.card h1, .card h2, .card h3 { margin: 0; }
.muted { color: #667085; margin: 0; }
.alert { margin: 0; color: #b42318; }
.callout {
  margin: 0;
  padding: 12px;
  border-radius: 10px;
  background: #f8fafc;
  overflow-wrap: anywhere;
}

.table-scroll { overflow-x: auto; }
.orgs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.orgs li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #e5e7eb;
}
.orgs li:last-child { border-bottom: 0; padding-bottom: 0; }
.orgs li > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.orgs .muted { overflow-wrap: anywhere; }
.orgs button { flex: 0 0 auto; white-space: nowrap; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid #e5e7eb; vertical-align: top; }
th { color: #667085; font-size: 13px; font-weight: 600; }
tbody tr:hover { background: #f8fafc; }

#invite-qr, #project-qr {
  width: 196px;
  padding: 8px;
  background: white;
  border-radius: 10px;
}

#invite-qr img, #invite-qr canvas, #project-qr img, #project-qr canvas { display: block; width: 180px; height: 180px; }

button.pick { text-align: left; white-space: normal; }
button.pick strong, button.pick span { display: block; }

.row { display: flex; gap: 8px; flex-wrap: wrap; }
.row > button, .row > a { flex: 0 0 auto; }

.grid .wide { grid-column: 1 / -1; }
details summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 600; }
details.card[open] > summary { padding-bottom: 10px; border-bottom: 1px solid #e5e7eb; }

.period { align-items: flex-end; }
.period label { flex: 1 1 160px; }

.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid #e5e7eb; border-radius: 10px; background: white; }
.stat span { color: #667085; font-size: 13px; font-weight: 600; }
.stat strong { font-size: 24px; letter-spacing: -0.03em; }
.stat.warn { background: #fef3f2; border-color: #fecdca; }
.stat.warn strong { color: #b42318; }
tr.late td { color: #b42318; }
.caution { margin: 0; padding: 10px 12px; border-radius: 8px; background: #fffaeb; color: #93370d; }

.check, .remember { flex-direction: row; align-items: center; gap: 8px; font-size: 16px; font-weight: 500; }
.check input, .remember input { width: 20px; min-height: 20px; }

@media (max-width: 800px) {
  .grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

body[data-screen="login"] .top { display: none; }

body[data-screen="login"] #app {
  max-width: none;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: #e7e9ee;
}

.gate {
  width: min(100%, 420px);
  margin: 0 auto;
  padding: 0;
  overflow: hidden;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
}

.gate-head {
  padding: 28px 24px 20px;
  background: #f7f9fc;
  text-align: center;
}

.gate-head h1 { margin: 0; font-size: 28px; letter-spacing: -0.03em; }
.gate-head p { margin: 8px 0 0; color: #475467; }

.gate-body { display: flex; flex-direction: column; gap: 14px; padding: 20px; }

.entry {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 6px;
  background: #f2f4f7;
  border-radius: 14px;
}

.entry a, .entry .current {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  text-decoration: none;
  color: #344054;
  font-weight: 700;
}

.entry .current { background: #0b57d0; color: white; }

.password-line { position: relative; display: block; }
.password-line input { padding-right: 76px; }
.password-line button {
  position: absolute;
  right: 6px;
  top: 6px;
  min-height: 36px;
  padding: 0 10px;
  background: transparent;
}

