*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.55; color: var(--text); background: var(--bg-app); min-height: 100vh; }
.app-header {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  height: 56px; padding: 0 24px; background: var(--surface);
  border-bottom: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.app-header .brand { justify-self: start; display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; color: var(--text); flex-wrap: wrap; }
.brand-cycle-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; margin-left: 6px; padding: 0;
  border: 1px solid var(--border); border-radius: 50%;
  background: var(--bg-app); cursor: pointer; color: var(--accent);
  font-family: inherit; font-size: 0; line-height: 0;
  box-shadow: var(--shadow-sm);
  transition: background .15s, border-color .15s, color .15s;
}
.brand-cycle-btn:hover { background: var(--accent-soft); border-color: var(--accent); }
.brand-cycle-btn:focus-visible { outline: 1px solid var(--accent); outline-offset: 1px; box-shadow: none; }
.brand-cycle-letter {
  font-size: 14px; font-weight: 800; line-height: 1; letter-spacing: -0.02em;
  pointer-events: none; user-select: none;
}
.brand-logo { height: 28px; width: auto; max-width: 160px; display: block; object-fit: contain; flex-shrink: 0; }
.app-header .nav-main { display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; }
.app-header .nav-main a {
  text-decoration: none; color: var(--text-muted); font-weight: 500; padding: 8px 12px; border-radius: 8px; font-size: 14px;
  border: 1px solid transparent;
}
.app-header .nav-main a:hover { color: var(--text); background: var(--bg-app); }
.app-header .nav-main a.is-active {
  color: var(--accent); background: var(--accent-soft); font-weight: 600;
  border-color: var(--accent-border-subtle);
}
/* 키보드: KRDS 이중 링 대신 얇은 accent outline (마우스 링은 krds-focus-overrides.css 전역) */
.app-header .nav-main a:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 2px;
  box-shadow: none;
}
.ai-nav-badge { display: inline-block; margin-left: 4px; font-size: 11px; font-weight: 700; color: var(--accent); background: none; padding: 0; vertical-align: middle; }
.app-header .header-right { justify-self: end; display: flex; align-items: center; gap: 16px; }
.notify-menu { position: relative; }
.notify-btn { position: relative; background: none; border: none; cursor: pointer; padding: 6px; color: var(--text-muted); line-height: 0; border-radius: 8px; }
.notify-btn:hover { background: var(--bg-app); color: var(--text); }
.notify-btn[aria-expanded="true"] { background: var(--accent-soft); color: var(--accent); }
.notify-btn .bell-icon { width: 22px; height: 22px; display: block; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.notify-btn .badge-count { position: absolute; top: -2px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; font-size: 11px; font-weight: 700; color: #fff; background: var(--danger); border-radius: 9px; line-height: 18px; text-align: center; }
.notify-btn .badge-count[hidden] { display: none; }
.notify-dropdown {
  position: absolute; top: calc(100% + 8px); right: -4px;
  width: 360px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
  z-index: 60; overflow: hidden;
  font-family: inherit;
}
.notify-dropdown[hidden] { display: none; }
.notify-dropdown__hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.notify-dropdown__title { font-size: 13px; font-weight: 700; color: var(--text); letter-spacing: -0.01em; }
.notify-mark-all {
  background: none; border: none; cursor: pointer;
  font-size: 12px; color: var(--accent); font-family: inherit; padding: 0;
}
.notify-mark-all:hover { text-decoration: underline; }
.notify-list {
  list-style: none; margin: 0; padding: 4px 0;
  max-height: 360px; overflow-y: auto;
}
.notify-item {
  position: relative;
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 16px; cursor: pointer;
  transition: background 0.15s ease;
  border: none; outline: none;
}
.notify-item + .notify-item { border-top: 1px solid var(--border); }
.notify-item:hover { background: var(--bg-app); }
.notify-item:focus-visible { background: var(--bg-app); outline: 1px solid var(--accent); outline-offset: -1px; }
.notify-item__icon {
  flex-shrink: 0; width: 32px; height: 32px; border-radius: 8px;
  background: var(--bg-app); color: var(--text-muted);
  display: inline-flex; align-items: center; justify-content: center;
}
.notify-item__icon svg { width: 16px; height: 16px; }
.notify-item__icon--accent { background: var(--accent-soft); color: var(--accent); }
.notify-item__body { flex: 1; min-width: 0; }
.notify-item__title {
  margin: 0; font-size: 13px; line-height: 1.4; color: var(--text);
  font-weight: 500;
}
.notify-item.is-unread .notify-item__title { font-weight: 700; }
.notify-item__desc {
  margin: 4px 0 0; font-size: 12px; color: var(--text-muted);
  line-height: 1.4; word-break: keep-all; overflow-wrap: anywhere;
}
.notify-item__time { margin: 6px 0 0; font-size: 11px; color: var(--text-muted); }
.notify-item__dot {
  flex-shrink: 0; width: 8px; height: 8px; border-radius: 50%;
  background: transparent; margin-top: 6px;
}
.notify-item.is-unread .notify-item__dot { background: var(--accent); }
.notify-dropdown__ft {
  padding: 8px 16px; border-top: 1px solid var(--border);
  text-align: center;
}
.notify-view-all {
  background: none; border: none; cursor: pointer; padding: 4px 8px;
  font-size: 12px; color: var(--text-muted); font-family: inherit;
}
.notify-view-all:hover { color: var(--accent); }
@media (max-width: 520px) {
  .notify-dropdown { width: calc(100vw - 24px); right: -8px; }
}
.account-menu { position: relative; }
.account-trigger {
  display: flex; align-items: center; gap: 8px; padding: 6px 4px; border: none; border-radius: 10px;
  background: transparent; cursor: pointer; font-family: inherit; font-size: 13px; color: var(--text);
}
.account-trigger:hover { background: var(--bg-app); }
.account-trigger .account-chevron { flex-shrink: 0; color: var(--text-muted); display: block; }
.account-trigger:focus:not(:focus-visible) { outline: none; }
.account-trigger:focus-visible { outline: 1px solid var(--accent); outline-offset: 1px; }
.account-trigger .av { width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.account-dropdown {
  display: none; position: absolute; top: calc(100% + 4px); right: 0; min-width: 180px; padding: 8px 0;
  background: var(--surface); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.1); z-index: 50;
}
.account-menu:hover .account-dropdown,
.account-menu:focus-within .account-dropdown { display: block; }
.account-dropdown button {
  display: block; width: 100%; text-align: left; padding: 10px 14px; border: none; background: none; font-size: 13px; color: var(--text-muted); cursor: default; font-family: inherit;
}
.account-dropdown button:hover { background: var(--bg-app); color: var(--text); }
.badge {
  display: inline-flex; align-items: center;
  padding: 4px 12px 5px;
  font-family: "Manrope", "Pretendard", system-ui, sans-serif;
  font-size: 12px; font-weight: 800; letter-spacing: -0.01em;
  text-transform: lowercase;
  color: #0f172a;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 999px;
  box-shadow:
    0 1px 1px rgba(15, 23, 42, 0.04),
    0 2px 6px rgba(15, 23, 42, 0.06),
    inset 0 -1px 0 rgba(15, 23, 42, 0.05);
}
main { padding: 20px 24px 40px; max-width: 1680px; margin: 0 auto; background: transparent; }
main.main-home-wide { max-width: none; padding: 16px 20px 36px; }
main.main-settings { max-width: none; padding: 0; }
.view { display: none; }
.view.is-visible { display: block; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.btn { font-family: inherit; font-size: 13px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; color: var(--text); }
.btn:hover { background: var(--bg-app); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; }
button:focus:not(:focus-visible),
.btn:focus:not(:focus-visible) {
  outline: none;
}
button:focus-visible,
.btn:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 1px;
}
.btn-ghost { border: none; background: transparent; color: var(--accent); }
.empty-state { color: var(--text-muted); text-align: center; padding: 28px 16px; font-size: 14px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
