:root {
  --bg: #faf7f5; --card: #ffffff; --text: #221d1b; --muted: #7a6f6a; --line: #ebe3df;
  --accent: #b5473f; --accent-soft: #fbe9e6; --tile-hover: #fff5f3; --btn-text: #fff;
  --ok: #2f7d4f; --ok-soft: #e3f4ea; --danger: #b5473f; --danger-soft: #fbe9e6;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161211; --card: #1f1917; --text: #f1eae6; --muted: #a0938d; --line: #2f2624;
    --accent: #e98b82; --accent-soft: #3a2320; --tile-hover: #2a1f1d; --btn-text: #161211;
    --ok: #7bd39c; --ok-soft: #1f3a2a; --danger: #f08a82; --danger-soft: #3d1f1c;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); line-height: 1.6;
  font-family: -apple-system, "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", "Roboto", sans-serif;
}
a { color: var(--accent); text-decoration: none; }

/* ---- front page ---- */
.page { max-width: 640px; margin: 0 auto; padding: 56px 20px 40px; padding-top: max(56px, env(safe-area-inset-top)); }
.hero .domain { margin: 0 0 6px; color: var(--muted); font-size: 13px; letter-spacing: .08em; text-transform: lowercase; }
.hero h1 { margin: 0; font-size: 44px; line-height: 1.1; letter-spacing: -0.02em; font-weight: 800; }
.hero .tagline { margin: 10px 0 0; font-size: 18px; color: var(--muted); }
.hero .intro { margin: 22px 0 0; font-size: 16px; max-width: 54ch; }

.contacts { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.contact { display: flex; gap: 8px; align-items: baseline; font-size: 15px; }
.contact .k { color: var(--muted); font-size: 13px; }
.contact .v { color: var(--text); }
.contact a.v { border-bottom: 1px solid var(--line); }
.contact a.v:hover { color: var(--accent); border-color: var(--accent); }

.links { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 30px; }
@media (min-width: 560px) { .links { grid-template-columns: repeat(3, 1fr); } }
.tile {
  position: relative; display: flex; flex-direction: column; gap: 2px; min-height: 92px;
  padding: 16px 16px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; color: var(--text);
  transition: transform .12s ease, border-color .12s ease, background .12s ease;
}
.tile:hover, .tile:focus-visible { transform: translateY(-2px); border-color: var(--accent); background: var(--tile-hover); outline: none; }
.tile .label { font-weight: 700; font-size: 17px; letter-spacing: -0.01em; word-break: keep-all; }
.tile .note { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .arrow { position: absolute; right: 14px; bottom: 12px; color: var(--muted); font-size: 14px; }
.tile:hover .arrow { color: var(--accent); }
.tile.auto .label::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 8px; vertical-align: 2px; opacity: .8; }

.foot { display: flex; justify-content: space-between; margin-top: 48px; color: var(--muted); font-size: 12px; }
.admin-link { color: var(--line); font-size: 18px; line-height: 1; padding: 0 6px; }
.admin-link:hover { color: var(--muted); }

/* ---- admin ---- */
.admin { max-width: 720px; margin: 0 auto; padding: 20px 16px 48px; }
.admin .top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0 18px; }
.admin .top h1 { margin: 0; font-size: 20px; }
.admin .top nav { display: flex; gap: 14px; font-size: 14px; }
.admin h2 { font-size: 15px; color: var(--muted); font-weight: 600; margin: 26px 0 10px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.card + .card { margin-top: 10px; }
.row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.row.inline { flex-direction: row; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.row.inline > * { flex: 1 1 140px; }
label { font-size: 13px; color: var(--muted); }
input[type=text], input[type=url], input[type=password], textarea {
  font: inherit; padding: 11px 13px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--text); width: 100%;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }
.btn {
  display: inline-block; font: inherit; font-weight: 700; padding: 11px 16px; border-radius: 12px; border: 0;
  background: var(--accent); color: var(--btn-text); cursor: pointer; text-align: center; white-space: nowrap;
}
.btn.small { padding: 8px 12px; font-size: 13px; font-weight: 600; }
.btn.secondary { background: var(--line); color: var(--text); }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.block { display: block; width: 100%; }
.btn:active { opacity: .85; }
.flash { padding: 12px 14px; border-radius: 12px; margin-bottom: 14px; font-size: 14px; }
.flash.ok { background: var(--ok-soft); color: var(--ok); }
.flash.err { background: var(--danger-soft); color: var(--danger); }
.item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.item:first-child { border-top: 0; padding-top: 0; }
.item .body { flex: 1; min-width: 0; }
.item .t { font-weight: 600; }
.item .s { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item form { display: inline; }
.item .btns { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.badge { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.badge.gray { background: var(--line); color: var(--muted); }
.login { max-width: 380px; margin: 60px auto 0; padding: 0 16px; }
.login h1 { text-align: center; font-size: 22px; }
