:root {
  --yellow: #fee500;
  --yellow-press: #f5dc00;
  --text: #191919;
  --sub: #767676;
  --line: #f0f0f0;
  --soft: #f5f5f5;
  --danger: #e54d2e;
  --bg: #ffffff;
  font-size: 16px;
  color-scheme: light;
}

html[data-size="large"] { font-size: 18px; }

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: #f7f7f7;
  color: var(--text);
  font-family: Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}

button, input, textarea, a { font: inherit; color: inherit; }

button { cursor: pointer; }

.app {
  width: min(100%, 430px);
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
}

.screen { min-height: 100dvh; }

.home-brand {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: calc(2.75rem + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 1.25rem 0;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
}

.home-brand h1 {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: inherit;
  text-decoration: none;
}

.home-top { padding: 0.35rem 1.25rem 0.35rem; }

h1, h2, p { margin: 0; }

.manage {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 0.15rem;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
}

.search {
  display: flex;
  align-items: center;
  height: 2.75rem;
  margin: 0.35rem 0 0.85rem;
  padding: 0 0.3rem 0 0.85rem;
  border-radius: 999px;
  background: var(--soft);
}

.search svg {
  flex: none;
  width: 1.15rem;
  height: 1.15rem;
  margin-right: 0.45rem;
  fill: none;
  stroke: #8e8e8e;
  stroke-width: 2;
  stroke-linecap: round;
}

.search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: transparent;
}

.search input:focus { outline: none; }

.search button {
  flex: none;
  height: 2.15rem;
  padding: 0 0.9rem;
  border: 0;
  border-radius: 999px;
  background: var(--yellow);
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 700;
}

.search button:active, .primary:active { background: var(--yellow-press); }

.home-top .form-error { margin-left: 0.15rem; margin-right: 0.15rem; }

.form-error {
  margin: -0.35rem 1.25rem 0.6rem;
  color: var(--danger);
  font-size: 0.86rem;
  font-weight: 600;
}

.form-error:empty { display: none; }

.chips {
  display: flex;
  gap: 0.4rem;
  margin: -0.2rem 0 0.8rem;
  overflow-x: auto;
}

.chip {
  flex: none;
  min-height: 2rem;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: var(--soft);
  color: var(--text);
  font-size: 0.86rem;
  text-decoration: none;
}

.section-label {
  margin: 0.35rem 0 0.15rem;
  padding: 0 1.25rem;
  color: var(--sub);
  font-size: 0.8rem;
  font-weight: 600;
}

.list { margin: 0; padding: 0 0.4rem; list-style: none; }

.row {
  display: flex;
  align-items: center;
  min-height: 4.25rem;
  padding: 0 0.55rem 0 0.85rem;
}

.row + .row { box-shadow: inset 0 1px 0 var(--line); }

.row-main {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 0.8rem;
  min-width: 0;
  min-height: 4.25rem;
  padding: 0.55rem 0;
  text-decoration: none;
}

.row-main:active { opacity: 0.55; }

.avatar, .mark {
  display: grid;
  flex: none;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
}

.avatar { background: var(--yellow); font-size: 1.25rem; }

.mark { color: white; font-size: 0.82rem; font-weight: 800; }

.row-text { min-width: 0; }

.row-text strong {
  display: block;
  overflow: hidden;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-text span, .note, .help {
  color: var(--sub);
  font-size: 0.8rem;
}

.row-text span {
  display: block;
  margin-top: 0.12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chevron {
  flex: none;
  width: 1.15rem;
  height: 1.15rem;
  margin-left: 0.35rem;
  fill: none;
  stroke: #c8c8c8;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nudge {
  display: flex;
  flex: none;
  flex-direction: column;
  margin-left: 0.15rem;
}

.nudge button {
  display: grid;
  width: 1.85rem;
  height: 1.7rem;
  place-items: center;
  border: 0;
  border-radius: 0.4rem;
  background: transparent;
  color: var(--text);
}

.nudge button:disabled { color: #d8d8d8; }

.nudge svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pin {
  display: grid;
  flex: none;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #d0d0d0;
}

.pin svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.8; }

.pin[aria-pressed="true"] { color: #191919; }

.pin[aria-pressed="true"] svg { fill: var(--yellow); stroke: #191919; }

.note, .help {
  margin: 0.85rem 1.25rem 0;
  line-height: 1.45;
}

.bar {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: env(safe-area-inset-top) 1.25rem 0.15rem;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
}

.bar .brand {
  align-self: flex-start;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.bar-row {
  display: grid;
  grid-template-columns: 2.75rem 1fr 2.75rem;
  align-items: center;
}

.bar h1 {
  overflow: hidden;
  font-size: 1.05rem;
  font-weight: 700;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar .back { margin-left: -0.6rem; }

.back, .bar-side {
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  color: var(--text);
  text-decoration: none;
}

.back svg {
  width: 1.55rem;
  height: 1.55rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.content { padding: 0.35rem 0 1.5rem; }

form.screen .content { padding-bottom: 5.5rem; }

.pad { padding: 0 1.25rem; }

.primary, .ghost, .text-danger {
  border: 0;
  font-weight: 700;
}

.primary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: calc(100% - 2.5rem);
  height: 3rem;
  margin: 0.2rem 1.25rem 0.85rem;
  border-radius: 0.75rem;
  background: var(--yellow);
  color: var(--text);
  text-decoration: none;
}

.list-block { margin-top: 0.35rem; }

.setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 3.25rem;
  padding: 0 1.25rem;
  border: 0;
  background: transparent;
  text-align: left;
  text-decoration: none;
}

.setting + .setting { box-shadow: inset 0 1px 0 var(--line); }

.switch {
  position: relative;
  width: 2.7rem;
  height: 1.6rem;
  border-radius: 999px;
  background: #e6e6e6;
}

.switch::after {
  content: "";
  position: absolute;
  top: 0.18rem;
  left: 0.18rem;
  width: 1.24rem;
  height: 1.24rem;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.16);
}

.switch.on { background: var(--yellow); }

.switch.on::after { transform: translateX(1.1rem); }

.field { display: block; margin: 0 1.25rem 0.85rem; }

.field span, .choice-label {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--sub);
  font-size: 0.8rem;
  font-weight: 600;
}

.field input, .field textarea {
  width: 100%;
  border: 0;
  border-radius: 0.75rem;
  background: var(--soft);
}

.field input { height: 2.9rem; padding: 0 0.9rem; }

.field input[type="color"] {
  width: 2.5rem;
  height: 2.5rem;
  margin-top: 0.45rem;
  padding: 0.15rem;
  border-radius: 50%;
}

.field textarea { min-height: 5rem; padding: 0.75rem 0.9rem; resize: vertical; }

.field input:focus, .field textarea:focus {
  outline: none;
  box-shadow: inset 0 0 0 1.5px #191919;
}

.choices, .swatches { display: flex; flex-wrap: wrap; gap: 0.45rem; }

.choices button, .swatches button, .color-input {
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 50%;
  background: var(--soft);
}

.choices button.selected, .swatches button.selected { box-shadow: 0 0 0 2px #191919; }

.link-box {
  margin: 0 1.25rem 0.75rem;
  padding: 0.9rem 0.9rem 0.15rem;
  border-radius: 0.9rem;
  background: #fafafa;
}

.link-box strong { display: block; margin-bottom: 0.65rem; font-size: 0.95rem; }

.link-box .field { margin: 0 0 0.75rem; }

.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin: 0.4rem 1.25rem 0.5rem;
}

.ghost {
  height: 2.75rem;
  border-radius: 0.75rem;
  background: var(--soft);
}

.ghost:disabled { color: #c8c8c8; }

.text-danger {
  display: block;
  width: calc(100% - 2.5rem);
  height: 2.75rem;
  margin: 0.2rem 1.25rem 0.5rem;
  border-radius: 0.75rem;
  background: transparent;
  color: var(--danger);
}

.savebar {
  position: sticky;
  bottom: 0;
  padding: 0.65rem 0 calc(0.75rem + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.94);
}

.savebar .primary { margin-bottom: 0; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.45);
}

.modal-card {
  width: min(100%, 18.5rem);
  overflow: hidden;
  border-radius: 0.9rem;
  background: white;
}

.modal-card p {
  padding: 1.35rem 1.15rem 1.15rem;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.45;
  text-align: center;
}

.modal-actions {
  display: flex;
  border-top: 1px solid var(--line);
}

.modal-actions button {
  flex: 1;
  height: 3rem;
  border: 0;
  background: white;
  font-weight: 600;
}

.modal-actions button + button { border-left: 1px solid var(--line); }

.modal-actions .danger { background: var(--yellow); color: var(--text); font-weight: 700; }

.empty a { color: var(--text); font-weight: 700; }

.empty {
  margin: 0.5rem 1.25rem;
  padding: 1.5rem 1rem;
  border-radius: 0.9rem;
  background: var(--soft);
  color: var(--sub);
  text-align: center;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

:focus-visible { outline: 2px solid #191919; outline-offset: 2px; }
