/* ------------------------------------------------------------------
   nav bar
   ------------------------------------------------------------------ */
.top {
  position: sticky; top: 0; z-index: 40;
  padding-top: var(--sa-t);
  background: rgba(0, 0, 0, 0.75);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.top::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--line); transform: scaleY(0.5); opacity: 0; transition: opacity 0.25s; }
body[data-scrolled="1"] .top::after { opacity: 1; }
.top__in { display: flex; align-items: center; gap: 6px; height: var(--header-h); }
.top__title {
  flex: 1; min-width: 0; text-align: center; padding: 0 6px;
  font-size: 17px; font-weight: 600; letter-spacing: -0.02em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  opacity: 0; transform: translateY(8px) scale(0.96); filter: blur(2px);
  transition: opacity 0.25s var(--ease-out), filter 0.25s var(--ease-out), transform var(--t-snappy) var(--spring-snappy);
}
body[data-scrolled="1"] .top__title { opacity: 1; transform: none; filter: blur(0); }
.top__act { display: grid; place-items: center; width: 40px; height: 40px; margin-right: -8px; border-radius: 50%; color: var(--accent); }
.top__act:active { opacity: 0.4; }

/* ------------------------------------------------------------------
   hero
   ------------------------------------------------------------------ */
.hero { padding: 18px 0 16px; }
.hero h1 { font-size: 34px; font-weight: 700; line-height: 1.15; letter-spacing: -0.026em; }
.hero p { margin-top: 6px; font-size: 15px; color: var(--fg-2); }

/* ------------------------------------------------------------------
   search + segmented control
   ------------------------------------------------------------------ */
.search {
  display: flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 10px;
  border-radius: var(--r-sm);
  background: var(--fill); color: var(--fg-2);
  transition: background 0.2s;
}
.search:focus-within { background: var(--fill-2); }
.search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; color: var(--fg); font-size: 17px; letter-spacing: -0.02em; }
.search input::placeholder { color: var(--fg-2); }
.search button { display: none; width: 18px; height: 18px; place-items: center; border-radius: 50%; background: var(--fg-2); color: var(--bg); }
.search button svg { width: 10px; height: 10px; stroke-width: 3; }
.search[data-filled="1"] button { display: grid; }

.seg {
  position: relative;
  display: flex;
  margin-top: 10px; padding: 2px;
  border-radius: 10px;
  background: var(--fill);
  overflow-x: auto; scrollbar-width: none;
  touch-action: pan-y;
  user-select: none; -webkit-user-select: none;
}
.seg::-webkit-scrollbar { display: none; }
.seg__thumb {
  position: absolute; top: 2px; left: 0;
  height: calc(100% - 4px); width: 0;
  border-radius: 8px;
  background: #636366;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25), 0 1px 1px rgba(0, 0, 0, 0.12);
  opacity: 0;
}
.seg[data-ready="1"] .seg__thumb { opacity: 1; transition: transform var(--t-snappy) var(--spring-snappy), width var(--t-snappy) var(--spring-snappy), scale 0.45s var(--spring-bouncy); }
.seg--drag .seg__thumb { scale: 1.03 1.08; transition: width 0.2s var(--ease-out), scale 0.45s var(--spring-bouncy); }
.seg__it {
  position: relative; z-index: 1;
  flex: 1 0 auto;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  height: 30px; padding: 0 12px;
  border-radius: 8px;
  font-size: 13px; font-weight: 500; letter-spacing: -0.01em; color: var(--fg);
  white-space: nowrap;
  transition: transform var(--t-snappy) var(--spring-snappy), opacity 0.15s;
}
.seg__it:active { transform: scale(0.94); opacity: 0.7; transition-duration: 0.09s, 0.09s; }
.seg--drag .seg__it:active { transform: none; opacity: 1; }
.seg__it[aria-selected="true"] { font-weight: 600; }
.seg__it span { color: var(--fg-2); font-weight: 400; }

/* ------------------------------------------------------------------
   home list
   ------------------------------------------------------------------ */
.home__list { padding-top: 26px; }
.group + .group { margin-top: 28px; }
.group, .block { content-visibility: auto; contain-intrinsic-size: auto 240px; }
.cell--go { background: var(--card-2); transform: scale(1.015); transition: transform 0.5s var(--spring-bouncy), background 0.08s; }

/* ------------------------------------------------------------------
   release / feedback item
   ------------------------------------------------------------------ */
.feedback-item {
  position: relative;
  display: flex; flex-direction: column; gap: 12px;
  padding: 16px;
  border-radius: var(--r-card);
  background: var(--card);
  transition: background 0.25s var(--ease-out), transform var(--t-snappy) var(--spring-snappy);
}
.feedback-item + .feedback-item { margin-top: 12px; }
.feedback-item:active { background: var(--card-2); transition-duration: 0.05s; }

.feedback-header {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap;
}
.feedback-rom {
  flex: none;
  display: inline-flex; align-items: center; gap: 5px;
  height: 26px; padding: 0 10px;
  border-radius: var(--r-pill);
  background: var(--fill);
  font-size: 13px; font-weight: 500; color: var(--fg-2);
  white-space: nowrap;
}
.feedback-rom--accent { background: var(--accent-soft); color: var(--accent); }
.feedback-date { flex: 1; font-size: 13px; color: var(--fg-2); text-align: right; }

.feedback-author { font-weight: 600; color: var(--accent-warm); font-size: 15px; }
.feedback-rating { color: #ffd60a; font-size: 15px; }
.feedback-text { color: var(--fg); line-height: 1.5; font-size: 15px; }

/* ------------------------------------------------------------------
   comments
   ------------------------------------------------------------------ */
.comments-section {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.comments-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
  font-weight: 600; color: var(--fg-2); font-size: 13px;
}
.comments-toggle { background: none; border: none; color: var(--accent); cursor: pointer; font-size: 13px; font-weight: 600; }
.comments-list { max-height: 200px; overflow-y: auto; margin-bottom: 12px; }
.comment-item { 
  background: var(--card-2); 
  padding: 12px; 
  border-radius: var(--r-md); 
  margin-bottom: 8px; 
  animation: in var(--t-snappy) var(--spring-snappy) both; 
}
.comment-header { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 12px; }
.comment-author { font-weight: 600; color: var(--accent-warm); }
.comment-date { color: var(--fg-2); }
.comment-text { color: var(--fg); line-height: 1.5; font-size: 14px; }

.comment-form { display: flex; gap: 8px; }
.comment-form textarea { flex: 1; min-height: 60px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--fg); font-size: 14px; resize: vertical; font-family: inherit; }
.comment-form textarea:focus { outline: none; border-color: var(--accent); }
.comment-submit { padding: 10px 16px; background: var(--accent); color: #fff; border: none; border-radius: 8px; font-weight: 600; cursor: pointer; font-size: 13px; white-space: nowrap; }
.comment-submit:disabled { opacity: 0.5; cursor: not-allowed; }

.login-prompt { text-align: center; padding: 16px; color: var(--fg-2); font-size: 13px; }
.login-prompt button { background: none; border: none; color: var(--accent); font-weight: 600; cursor: pointer; text-decoration: underline; }

/* ------------------------------------------------------------------
   feedback form
   ------------------------------------------------------------------ */
.feedback-form {
  background: var(--card);
  border-radius: var(--r-card);
  padding: 20px;
}
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 13px; color: var(--fg-2); }
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--card);
  color: var(--fg);
  font-size: 17px;
  transition: border-color 0.2s, background 0.2s;
  -webkit-appearance: none;
  appearance: none;
}
.form-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238e8e93' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
  cursor: pointer;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus { outline: none; border-color: var(--accent); background: var(--card-2); }
.form-group select option { background: var(--card-2); color: var(--fg); }

.rating {
  display: flex; gap: 8px; justify-content: center; margin: 8px 0;
}
.rating input { display: none; }
.rating label {
  cursor: pointer; font-size: 28px; color: var(--fg-3);
  transition: color 0.2s, transform 0.2s;
  user-select: none;
}
.rating label:hover,
.rating label.filled { color: #ffd60a; transform: scale(1.1); }

.checkbox-label {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 8px;
  cursor: pointer; font-weight: normal; color: var(--fg-2); font-size: 13px;
}
.checkbox-label input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }

.btn-submit {
  width: 100%; min-height: 50px;
  background: var(--accent); color: #fff;
  border: none; border-radius: var(--r-md);
  font-size: 17px; font-weight: 600; letter-spacing: -0.02em;
  cursor: pointer;
  transition: background 0.1s, transform 0.1s;
}
.btn-submit:hover { background: #0078e8; transform: scale(0.99); }
.btn-submit:active { transform: scale(0.98); transition-duration: 0.05s; }
.btn-submit:disabled { opacity: 0.5; cursor: not-allowed; }

/* ------------------------------------------------------------------
   auth modal
   ------------------------------------------------------------------ */
.auth-modal {
  position: fixed; inset: 0; z-index: 90; display: none; place-items: center; padding: 20px;
  background: rgba(0, 0, 0, 0.75);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.auth-modal[data-open="1"] { display: grid; animation: lb-in 0.35s var(--spring-smooth); }
.auth-modal__bg {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.42);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  animation: fade-in 0.25s var(--ease-out);
}
.auth-modal__box {
  position: relative;
  width: 100%; max-width: 360px;
  border-radius: var(--r-card); overflow: hidden;
  background: var(--card);
  text-align: center;
  animation: alert-in 0.38s var(--spring-snappy);
}
.auth-modal__close {
  position: absolute; top: 12px; right: 12px;
  display: grid; place-items: center; width: 34px; height: 34px;
  border-radius: 50%; background: var(--fill-2); color: var(--fg);
}
.auth-modal__close:active { background: var(--fill); }
.auth-tabs {
  display: flex; border-bottom: 1px solid var(--line);
}
.auth-tab {
  flex: 1; padding: 14px;
  background: none; border: none; color: var(--fg-2);
  font-weight: 600; font-size: 15px; cursor: pointer;
  position: relative;
  transition: color 0.2s;
}
.auth-tab.active { color: var(--accent); }
.auth-tab.active::after {
  content: ''; position: absolute; bottom: -1px; left: 0; right: 0;
  height: 2px; background: var(--accent);
}
.auth-form { display: none; padding: 24px; }
.auth-form.active { display: block; animation: fade-in 0.25s var(--ease-out); }
.auth-form .form-group { margin-bottom: 16px; }
.auth-form label { display: block; margin-bottom: 6px; font-size: 13px; color: var(--fg-2); text-align: left; }
.auth-form input { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--card-2); color: var(--fg); font-size: 17px; }
.auth-form input:focus { outline: none; border-color: var(--accent); }
.auth-form .btn { margin-top: 8px; }

.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 0; color: var(--fg-3); font-size: 13px;
}
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.guest-btn {
  background: var(--fill) !important; color: var(--fg) !important;
  border: 1px solid var(--line) !important;
}
.guest-btn:hover { background: var(--accent) !important; color: #fff !important; border-color: var(--accent) !important; }

/* ------------------------------------------------------------------
   settings modal
   ------------------------------------------------------------------ */
.settings-modal {
  position: fixed; inset: 0; z-index: 95; display: none; place-items: center; padding: 20px;
  background: rgba(0, 0, 0, 0.75);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.settings-modal[data-open="1"] { display: grid; animation: lb-in 0.35s var(--spring-smooth); }
.settings-modal__bg {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.42);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  animation: fade-in 0.25s var(--ease-out);
}
.settings-modal__box {
  position: relative;
  width: 100%; max-width: 360px;
  border-radius: var(--r-card); overflow: hidden;
  background: var(--card);
  animation: alert-in 0.38s var(--spring-snappy);
}
.settings-modal__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px; border-bottom: 1px solid var(--line);
}
.settings-modal__header h2 { font-size: 17px; font-weight: 600; }
.settings-modal__close {
  display: grid; place-items: center; width: 34px; height: 34px;
  border-radius: 50%; background: var(--fill-2); color: var(--fg);
}
.settings-modal__close:active { background: var(--fill); }
.settings-modal__body { padding: 16px; }
.settings-section { margin-bottom: 24px; }
.settings-section:last-child { margin-bottom: 0; }
.settings-label { display: block; font-size: 13px; font-weight: 600; color: var(--fg-2); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px; }
.account-status { padding: 12px; background: var(--fill); border-radius: var(--r-md); font-size: 14px; color: var(--fg-2); text-align: center; margin-bottom: 12px; }

/* ------------------------------------------------------------------
   alert / toast / footer
   ------------------------------------------------------------------ */
.alert { position: fixed; inset: 0; z-index: 95; display: none; place-items: center; padding: 20px; }
.alert[data-open="1"] { display: grid; }
.alert__bg {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.42);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  animation: fade-in 0.25s var(--ease-out);
}
.alert__box {
  position: relative;
  width: 270px; max-width: 100%;
  border-radius: 14px; overflow: hidden;
  background: rgba(44, 44, 46, 0.85);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  text-align: center;
  animation: alert-in 0.38s var(--spring-snappy);
}
.alert__body { padding: 19px 16px 16px; }
.alert__box h3 { font-size: 17px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.3; }
.alert__box p { margin-top: 4px; font-size: 13px; line-height: 1.35; letter-spacing: -0.005em; }
.alert__host { display: block; margin-top: 10px; font-size: 12px; color: var(--fg-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alert__acts { display: flex; border-top: 0.5px solid var(--line); }
.alert__acts button { flex: 1; min-width: 0; height: 44px; font-size: 17px; letter-spacing: -0.02em; color: var(--accent); transition: background 0.12s; }
.alert__acts button + button { border-left: 0.5px solid var(--line); }
.alert__acts button:active { background: rgba(255, 255, 255, 0.06); transition: none; }
.alert__pri { font-weight: 600; }

.toast {
  position: fixed; left: 50%; top: calc(var(--sa-t) + 12px); z-index: 96;
  padding: 10px 18px; border-radius: var(--r-pill);
  background: var(--card-2); color: var(--fg); box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
  font-size: 15px; font-weight: 600; letter-spacing: -0.02em;
  opacity: 0; transform: translate(-50%, -24px) scale(0.9); pointer-events: none;
  transition: opacity 0.2s var(--ease-out), transform var(--t-bouncy) var(--spring-bouncy);
}
.toast[data-show="1"] { opacity: 1; transform: translate(-50%, 0) scale(1); }

.foot { display: flex; flex-wrap: wrap; gap: 16px; padding-top: 40px; padding-bottom: calc(36px + var(--sa-b)); font-size: 13px; color: var(--fg-3); justify-content: center; }
.foot a { color: var(--accent); }

/* ------------------------------------------------------------------
   page transitions
   ------------------------------------------------------------------ */
body[data-nav="push"] #app { animation: lift-in var(--t-lift) var(--spring-lift) both, fade-in 0.28s var(--ease-out) both; }
body[data-nav="pop"]  #app { animation: pop-in var(--t-smooth) var(--spring-smooth) both, fade-in 0.28s var(--ease-out) both; }
@keyframes lift-in { from { transform: translateY(64px) scale(0.98); } }
@keyframes pop-in  { from { transform: translateY(-14px); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes alert-in  { from { opacity: 0; transform: scale(1.15); } to { opacity: 1; transform: scale(1); } }
@keyframes alert-out { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(1.15); } }
@keyframes fade-in   { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-out  { from { opacity: 1; } to { opacity: 0; } }
@keyframes lb-in  { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }
@keyframes lb-out { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(0.96); } }

/* ------------------------------------------------------------------
   Glass theme overrides
   ------------------------------------------------------------------ */
[data-theme="alpha-glass"] .top {
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--glass-border);
}
[data-theme="alpha-glass"] .card,
[data-theme="alpha-glass"] .feedback-item,
[data-theme="alpha-glass"] .feedback-form,
[data-theme="alpha-glass"] .comment-item,
[data-theme="alpha-glass"] .auth-modal__box,
[data-theme="alpha-glass"] .settings-modal__box,
[data-theme="alpha-glass"] .alert__box {
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: 
    0 4px 24px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}
[data-theme="alpha-glass"] .feedback-form,
[data-theme="alpha-glass"] .feedback-item,
[data-theme="alpha-glass"] .comment-item {
  border: 1px solid var(--glass-border);
}
[data-theme="alpha-glass"] .seg,
[data-theme="alpha-glass"] .search,
[data-theme="alpha-glass"] .pill {
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
}
[data-theme="alpha-glass"] .rom-btn {
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
}
[data-theme="alpha-glass"] .rom-btn:hover,
[data-theme="alpha-glass"] .rom-btn.active {
  background: var(--accent);
  color: #fff;
}
[data-theme="alpha-glass"] .form-group input,
[data-theme="alpha-glass"] .form-group textarea,
[data-theme="alpha-glass"] .auth-form input {
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
}
[data-theme="alpha-glass"] .btn-submit {
  background: var(--accent);
  color: #fff;
}
[data-theme="alpha-glass"] .footer,
[data-theme="alpha-glass"] .foot {
  border-top: 1px solid var(--glass-border);
}

/* ------------------------------------------------------------------
   empty/loading states
   ------------------------------------------------------------------ */
.empty-state { text-align: center; color: var(--fg-3); padding: 40px 16px; }

/* ------------------------------------------------------------------
   device badge
   ------------------------------------------------------------------ */
.device-badge {
  display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px;
  background: var(--fill);
  color: var(--fg-2);
  padding: 5px 14px;
  border-radius: var(--r-pill);
  font-size: 13px;
  margin-bottom: 16px;
}
.device-label { color: var(--success); font-weight: 600; }
.recovery-label { color: #7b2ff7; font-weight: 600; }

/* ------------------------------------------------------------------
   android badge
   ------------------------------------------------------------------ */
.android-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 6px;
  margin-left: 8px;
  background: linear-gradient(135deg, var(--success), var(--success-hover));
  color: #fff;
  border-radius: 10px;
  font-size: 11px; font-weight: 700; line-height: 1;
}