/* Les polices sont chargées via fonts.css, auto-hébergées. */

/* ---------------------------------------------
   Design tokens
--------------------------------------------- */
:root {
  --bg: #070b14;
  --bg-soft: #0b1120;

  --surface: rgba(17, 25, 41, 0.72);
  --surface-strong: rgba(23, 33, 52, 0.92);
  --surface-hover: rgba(32, 45, 68, 0.85);

  --text-primary: #f5f7fb;
  --text-secondary: #9aa8bd;
  --text-muted: #6f7f96;

  --accent: #ff8a7a;
  --accent-strong: #ff6b5b;
  --accent-2: #ffc46b;
  --accent-ink: #24110d;
  --accent-grad: linear-gradient(135deg, #ff8a7a 0%, #ffc46b 100%);

  --danger: #fb7185;
  --success: #4ade80;

  --border: rgba(148, 163, 184, 0.13);
  --border-hover: rgba(255, 255, 255, 0.2);
  --border-accent: rgba(255, 138, 122, 0.38);

  --radius: 20px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --radius-pill: 999px;

  --shadow-lg: 0 30px 70px -28px rgba(0, 0, 0, 0.75);
  --shadow-md: 0 18px 40px -24px rgba(0, 0, 0, 0.7);
  --shadow-accent: 0 14px 32px -14px rgba(255, 138, 122, 0.65);
  --ring: 0 0 0 3px rgba(255, 138, 122, 0.16);

  --font-ui: "Outfit", ui-sans-serif, system-ui, sans-serif;
  --font-display: "Fraunces", Georgia, serif;
}

/* ---------------------------------------------
   Base
--------------------------------------------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  color-scheme: dark;
}

body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(1100px 620px at 8% -10%, rgba(255, 107, 91, 0.16), transparent 62%),
    radial-gradient(900px 540px at 108% 6%, rgba(255, 196, 107, 0.1), transparent 58%),
    radial-gradient(900px 600px at 50% 115%, rgba(99, 102, 241, 0.12), transparent 62%),
    linear-gradient(180deg, #080d18 0%, #070b14 55%, #060910 100%);
}

h1,
h2,
h3 {
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 7vw, 2.85rem);
  font-weight: 700;
  background: linear-gradient(120deg, #ffffff 0%, #ffd9a8 48%, #ff9a8b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

a {
  color: var(--accent);
}

::selection {
  background: rgba(255, 138, 122, 0.3);
  color: #fff;
}

/* ---------------------------------------------
   Background decor
--------------------------------------------- */
#background {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

#background > span {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
  animation: float 20s ease-in-out infinite;
}

#background > span:nth-child(1) {
  width: 540px;
  height: 540px;
  top: -220px;
  left: -160px;
  background: radial-gradient(circle, rgba(255, 107, 91, 0.4), transparent 66%);
}

#background > span:nth-child(2) {
  width: 480px;
  height: 480px;
  top: 24%;
  right: -200px;
  background: radial-gradient(circle, rgba(255, 196, 107, 0.26), transparent 66%);
  animation-delay: -7s;
}

#background > span:nth-child(3) {
  width: 460px;
  height: 460px;
  bottom: -220px;
  left: 32%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.24), transparent 66%);
  animation-delay: -13s;
}

#background > div {
  position: absolute;
  inset: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
}

/* ---------------------------------------------
   Layout
--------------------------------------------- */
#app {
  position: relative;
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  padding: 26px 20px 72px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

#auth-view,
#admin-login-view,
#admin-dash-view,
#main-view {
  animation: fadeUp 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

[hidden] {
  display: none !important;
}

/* ---------------------------------------------
   Brand
--------------------------------------------- */
#main-view > nav > div:first-child,
#admin-dash-view > nav > div:first-child {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 14px;
  font-size: 1.25rem;
  background: linear-gradient(145deg, rgba(255, 138, 122, 0.2), rgba(255, 196, 107, 0.12));
  border: 1px solid rgba(255, 196, 107, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 10px 24px -16px rgba(255, 138, 122, 0.8);
}

#auth-view > header > .brand-mark,
#admin-login-view > header > .brand-mark {
  width: 68px;
  height: 68px;
  border-radius: 22px;
  font-size: 2rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 24px 50px -22px rgba(255, 138, 122, 0.85);
}

#admin-login-view > header > .brand-mark,
#admin-dash-view > nav .brand-mark {
  color: var(--accent-2);
  background: linear-gradient(145deg, rgba(255, 196, 107, 0.18), rgba(255, 107, 91, 0.1));
}

#main-view > nav > div:first-child > span:last-child,
#admin-dash-view > nav > div:first-child > span:last-child {
  font-weight: 600;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

/* ---------------------------------------------
   Auth
--------------------------------------------- */
#auth-view,
#admin-login-view {
  min-height: calc(100dvh - 98px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 26px;
}

#auth-view > header,
#admin-login-view > header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

#auth-view > header p,
#admin-login-view > header p {
  margin-top: 8px;
  color: var(--text-secondary);
  font-size: 0.95rem;
  max-width: 400px;
}

#auth-view > div,
#admin-login-view > div {
  display: block;
  width: 100%;
  padding: 28px;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

#auth-view > div > header,
#admin-login-view > div > header {
  margin-bottom: 22px;
}

#auth-view > div > header h2,
#admin-login-view > div > header h2 {
  font-size: 1.35rem;
}

#auth-view > div > header p,
#admin-login-view > div > header p {
  color: var(--text-secondary);
  font-size: 0.88rem;
  margin-top: 4px;
}

#auth-view > div > footer,
#admin-login-view > div > footer {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

#auth-view > p:last-child {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

/* ---------------------------------------------
   Forms
--------------------------------------------- */
#auth-form > .field,
#admin-login-form > .field {
  margin-bottom: 15px;
}

#auth-form > label,
#admin-login-form > label {
  display: block;
  font-size: 0.76rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 7px;
}

.field {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.field > ion-icon {
  position: absolute;
  left: 14px;
  font-size: 1.05rem;
  color: var(--text-muted);
  pointer-events: none;
  transition: color 0.2s;
}

.field:focus-within > ion-icon {
  color: var(--accent);
}

input {
  width: 100%;
  padding: 13px 15px 13px 42px;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text-primary);
  background: rgba(6, 10, 19, 0.55);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

input::placeholder {
  color: var(--text-muted);
}

input:hover {
  border-color: rgba(148, 163, 184, 0.24);
}

input:focus {
  outline: none;
  border-color: var(--border-accent);
  background: rgba(6, 10, 19, 0.75);
  box-shadow: var(--ring);
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text-primary);
  -webkit-box-shadow: 0 0 0 1000px #0b1120 inset;
  transition: background-color 9999s ease-out;
}

/* ---------------------------------------------
   Buttons
--------------------------------------------- */
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 18px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent-ink);
  background: var(--accent-grad);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: var(--shadow-accent);
  transition: transform 0.15s ease, filter 0.2s ease, box-shadow 0.2s ease;
}

button ion-icon {
  font-size: 1.15rem;
}

button:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0) scale(0.99);
}

button:focus-visible {
  outline: none;
  box-shadow: var(--ring), var(--shadow-accent);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

#add-secret-form .composer-submit {
  width: auto;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  box-shadow: none;
  white-space: nowrap;
}

#add-secret-form .composer-submit:hover {
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.07);
}

#auth-view footer button,
#admin-login-view footer button {
  width: auto;
  align-self: center;
  padding: 8px 10px;
  color: var(--accent);
  background: transparent;
  border: none;
  box-shadow: none;
  font-size: 0.88rem;
  font-weight: 500;
}

#auth-view footer button:hover,
#admin-login-view footer button:hover {
  color: var(--accent-2);
  background: transparent;
  filter: none;
  transform: none;
}

#auth-view footer button:last-child {
  color: var(--text-muted);
  font-size: 0.78rem;
}

#auth-view footer button:last-child:hover {
  color: var(--text-secondary);
}

#add-item-form .composer-submit {
  width: auto;
  white-space: nowrap;
}

#tmpl-user-list-back-btn {
  width: auto;
  align-self: flex-start;
  padding: 0;
  margin-bottom: 10px;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  box-shadow: none;
  font-size: 0.82rem;
  font-weight: 500;
}

#tmpl-user-list-back-btn:hover {
  color: var(--accent);
  background: transparent;
  filter: none;
  transform: none;
}

/* ---------------------------------------------
   Top navigation
--------------------------------------------- */
#main-view > nav,
#admin-dash-view > nav {
  position: sticky;
  top: 14px;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  background: rgba(10, 16, 28, 0.72);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  box-shadow: 0 18px 40px -28px rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

#main-view > nav > div:last-child,
#admin-dash-view > nav > div:last-child {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

#main-view > nav button,
#admin-dash-view > nav button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: auto;
  padding: 9px 14px;
  color: var(--text-secondary);
  font-size: 0.86rem;
  font-weight: 500;
  white-space: nowrap;
  background: transparent;
  border: 0;
  border-radius: var(--radius-pill);
  box-shadow: none;
  cursor: pointer;
  transition: color 0.2s, background 0.2s, box-shadow 0.2s;
}

#main-view > nav button ion-icon,
#admin-dash-view > nav button ion-icon {
  font-size: 1.05rem;
}

#main-view > nav button:hover,
#admin-dash-view > nav button:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
  filter: none;
  transform: none;
}

#main-view > nav button[aria-current="page"] {
  color: var(--accent-ink);
  background: var(--accent-grad);
  box-shadow: 0 8px 20px -12px rgba(255, 138, 122, 0.95);
}

#main-view > nav button:last-child {
  color: var(--text-muted);
}

/* ---------------------------------------------
   Page headers
--------------------------------------------- */
#content-area > header,
#admin-dash-view > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

#content-area > header h2,
#admin-dash-view > header h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4.6vw, 2rem);
  font-weight: 600;
}

#content-area > header p,
#admin-dash-view > header p {
  margin-top: 6px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  max-width: 520px;
}

#my-items-count,
#admin-dash-view > header > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  padding: 6px 12px;
  color: #a7f3d0;
  font-size: 0.74rem;
  font-weight: 600;
  white-space: nowrap;
  background: rgba(74, 222, 128, 0.09);
  border: 1px solid rgba(74, 222, 128, 0.22);
  border-radius: var(--radius-pill);
}

#my-items-count ion-icon,
#admin-dash-view > header > span ion-icon {
  font-size: 0.9rem;
}

#admin-dash-view > header > span {
  color: #fcd34d;
  background: rgba(251, 191, 36, 0.08);
  border-color: rgba(251, 191, 36, 0.24);
}

/* ---------------------------------------------
   Composer (add item)
--------------------------------------------- */
#add-item-form,
#add-secret-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  margin-bottom: 22px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

#add-secret-form {
  margin-bottom: 0;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.composer-body {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.composer-adders {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.add-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: auto;
  padding: 8px 13px;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  box-shadow: none;
}

.add-chip:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--border-hover);
  filter: none;
  transform: translateY(-1px);
}

.add-chip:active {
  transform: scale(0.98);
}

.add-chip-icon {
  position: relative;
  display: grid;
  place-items: center;
}

.add-chip-icon ion-icon {
  font-size: 1.1rem;
}

.add-chip-plus {
  position: absolute;
  right: -7px;
  bottom: -7px;
  display: grid;
  place-items: center;
  width: 15px;
  height: 15px;
  color: var(--accent-ink);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  background: var(--accent-grad);
  border: 1px solid rgba(7, 11, 20, 0.65);
  border-radius: 50%;
}

.composer-extra[hidden] {
  display: none;
}

.composer-text {
  width: 100%;
  min-height: 78px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 0.93rem;
  color: var(--text-primary);
  background: rgba(6, 10, 19, 0.55);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.composer-text::placeholder {
  color: var(--text-muted);
}

.composer-text:hover {
  border-color: rgba(148, 163, 184, 0.24);
}

.composer-text:focus {
  outline: none;
  border-color: var(--border-accent);
  background: rgba(6, 10, 19, 0.75);
  box-shadow: var(--ring);
}

.links-editor {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.link-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.link-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.link-row .field {
  flex: 1 1 auto;
}

.ghost-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  align-self: flex-start;
  width: auto;
  padding: 8px 12px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 500;
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: var(--radius-pill);
  box-shadow: none;
}

.ghost-btn:hover {
  color: var(--accent-2);
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 138, 122, 0.35);
  filter: none;
  transform: none;
}

.photos-editor {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.photo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.file-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.file-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--border-hover);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.photo-previews {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.photo-preview {
  position: relative;
  width: 84px;
  height: 84px;
  overflow: hidden;
  background: rgba(6, 10, 19, 0.6);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  color: #fff;
  background: rgba(7, 11, 20, 0.78);
  border: none;
  border-radius: 50%;
  box-shadow: none;
}

.preview-remove:hover {
  background: var(--danger);
  filter: none;
  transform: none;
}

.preview-remove ion-icon {
  font-size: 0.85rem;
}

.photo-size {
  position: absolute;
  left: 4px;
  bottom: 4px;
  padding: 1px 5px;
  color: #fff;
  font-size: 0.6rem;
  font-weight: 600;
  background: rgba(7, 11, 20, 0.72);
  border-radius: var(--radius-pill);
}

.photo-pending {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: center;
  padding: 8px 12px;
  color: var(--text-muted);
  font-size: 0.78rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
}

.photo-pending ion-icon {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.composer-submit {
  align-self: flex-end;
  width: auto;
  white-space: nowrap;
}

/* ---------------------------------------------
   Lists & cards
--------------------------------------------- */
#my-items-list,
#sub-list,
#user-items-list,
#admin-user-list {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.015));
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  animation: fadeUp 0.35s ease both;
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025));
}

.item-content {
  flex: 1 1 auto;
  min-width: 0;
}

.item-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 1.02rem;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.item-meta {
  margin-top: 5px;
  color: var(--text-secondary);
  font-size: 0.82rem;
}

.item-meta a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.item-meta a:hover {
  border-bottom-color: currentColor;
}

.item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  border-radius: 12px;
  box-shadow: none;
}

.icon-btn ion-icon {
  font-size: 1.2rem;
}

.icon-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border);
  filter: none;
  transform: none;
}

.icon-btn.text-danger:hover {
  color: var(--danger);
  background: rgba(251, 113, 133, 0.1);
  border-color: rgba(251, 113, 133, 0.28);
}

.icon-btn.text-success:hover {
  color: var(--success);
  background: rgba(74, 222, 128, 0.1);
  border-color: rgba(74, 222, 128, 0.28);
}

.icon-btn:disabled {
  opacity: 0.45;
  background: transparent;
}

.taken .item-title {
  text-decoration: line-through;
  text-decoration-color: rgba(154, 168, 189, 0.55);
  opacity: 0.62;
}

.secret-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  color: #bbf7d0;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(74, 222, 128, 0.12);
  border: 1px solid rgba(74, 222, 128, 0.3);
  border-radius: var(--radius-pill);
}

/* ---------------------------------------------
   Subscriptions
--------------------------------------------- */
.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 4px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.section-title.accent {
  color: var(--accent);
}

.section-title ion-icon {
  font-size: 0.95rem;
}

.section-title + .sub-row {
  margin-top: 4px;
}

.section-gap {
  margin-top: 22px;
}

.sub-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012));
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.sub-row:hover {
  transform: translateY(-1px);
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.055);
}

.sub-row .icon-btn {
  width: 36px;
  height: 36px;
}

.muted-note {
  padding: 6px 2px 2px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.sub-user {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
  cursor: pointer;
}

.sub-user ion-icon {
  flex: 0 0 auto;
  font-size: 1.2rem;
  color: var(--text-secondary);
}

.sub-user span {
  overflow: hidden;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.admin-user .item-meta {
  margin-top: 1px;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.btn-danger {
  width: auto;
  flex: 0 0 auto;
  padding: 9px 13px;
  color: #fecdd3;
  font-size: 0.82rem;
  background: rgba(251, 113, 133, 0.1);
  border: 1px solid rgba(251, 113, 133, 0.26);
  box-shadow: none;
}

.btn-danger:hover {
  color: #fff;
  background: rgba(251, 113, 133, 0.18);
  border-color: rgba(251, 113, 133, 0.45);
  filter: none;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 7px;
  padding: 3px 9px;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: var(--radius-pill);
}

.status-badge ion-icon {
  font-size: 0.85rem;
}

.status-success {
  color: #bbf7d0;
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.26);
}

.status-danger {
  color: #fecdd3;
  background: rgba(251, 113, 133, 0.09);
  border: 1px solid rgba(251, 113, 133, 0.24);
}

/* ---------------------------------------------
   Secret panel
--------------------------------------------- */
#secret-panel {
  padding: 18px;
  margin-bottom: 22px;
  background:
    linear-gradient(155deg, rgba(255, 196, 107, 0.09), rgba(255, 107, 91, 0.035));
  border: 1px dashed rgba(255, 196, 107, 0.32);
  border-radius: var(--radius-md);
}

#secret-panel > header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

#secret-panel > header > span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  color: var(--accent-2);
  font-size: 1.15rem;
  background: rgba(255, 196, 107, 0.12);
  border: 1px solid rgba(255, 196, 107, 0.24);
  border-radius: 13px;
}

#secret-panel > header h3 {
  font-size: 0.98rem;
}

#secret-panel > header p {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

#add-secret-form {
  gap: 12px;
}

/* ---------------------------------------------
   Empty states
--------------------------------------------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 42px 24px;
  text-align: center;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.015);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
}

.empty-state ion-icon {
  font-size: 1.9rem;
  color: var(--text-muted);
}

.empty-state p {
  font-size: 0.92rem;
  color: var(--text-secondary);
}

.empty-state span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ---------------------------------------------
   Toasts
--------------------------------------------- */
#toast-stack {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(92vw, 420px);
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  color: var(--text-primary);
  font-size: 0.88rem;
  background: rgba(14, 21, 36, 0.96);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(16px);
  animation: toastIn 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
  pointer-events: auto;
}

.toast ion-icon {
  font-size: 1.1rem;
  flex: 0 0 auto;
}

.toast.success {
  border-color: rgba(74, 222, 128, 0.35);
}

.toast.success ion-icon {
  color: var(--success);
}

.toast.error {
  border-color: rgba(251, 113, 133, 0.38);
}

.toast.error ion-icon {
  color: var(--danger);
}

.toast.info ion-icon {
  color: var(--accent);
}

.toast.leaving {
  animation: toastOut 0.2s ease forwards;
}

/* ---------------------------------------------
   Item media
--------------------------------------------- */
.item-description {
  margin-top: 6px;
  color: var(--text-secondary);
  font-size: 0.86rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.item-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 8px;
}

.item-links a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--accent);
  font-size: 0.8rem;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.item-links a:hover {
  border-bottom-color: currentColor;
}

.item-links ion-icon {
  font-size: 0.9rem;
}

.item-photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 8px;
  max-width: 420px;
  margin-top: 10px;
}

.item-photo {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: rgba(6, 10, 19, 0.6);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.item-photo-link {
  display: block;
  width: 100%;
  height: 100%;
}

.item-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease;
}

.item-photo:hover img {
  transform: scale(1.04);
}

.photo-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  color: #fff;
  background: rgba(7, 11, 20, 0.82);
  border: none;
  border-radius: 50%;
  box-shadow: none;
}

.photo-remove:hover {
  color: #fff;
  background: var(--danger);
  filter: none;
  transform: none;
}

.photo-remove:active {
  transform: scale(0.95);
}

.photo-remove ion-icon {
  font-size: 0.9rem;
}

/* ---------------------------------------------
   Password toggle
--------------------------------------------- */
.field-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: 10px;
  box-shadow: none;
  transform: translateY(-50%);
}

.field-toggle:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
  filter: none;
  transform: translateY(-50%);
}

.field-toggle:active {
  transform: translateY(-50%) scale(0.96);
}

.field-toggle ion-icon {
  font-size: 1.05rem;
}

#password,
#admin-password {
  padding-right: 48px;
}

/* ---------------------------------------------
   Edit item modal
--------------------------------------------- */
#edit-item-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  overflow-y: auto;
  background: rgba(4, 7, 13, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

#edit-item-modal[hidden] {
  display: none;
}

.edit-modal-card {
  width: min(100%, 640px);
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}

.edit-modal-card > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.edit-modal-card > header h2 {
  font-size: 1.15rem;
}

.edit-modal-card .icon-btn svg {
  width: 18px;
  height: 18px;
}

#edit-item-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#edit-item-form > div > .ghost-btn {
  margin-top: 8px;
}

.edit-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.edit-modal-actions .ghost-btn,
.edit-modal-actions .composer-submit {
  width: auto;
}

body.edit-open {
  overflow: hidden;
}

/* ---------------------------------------------
   Photo viewer
--------------------------------------------- */
#photo-viewer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(4, 7, 13, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

#photo-viewer[hidden] {
  display: none;
}

#photo-viewer img {
  position: relative;
  z-index: 0;
  display: block;
  max-width: min(100%, 1200px);
  max-height: 88vh;
  object-fit: contain;
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
}

.photo-viewer-close {
  position: fixed;
  top: max(14px, env(safe-area-inset-top, 0px));
  right: max(14px, env(safe-area-inset-right, 0px));
  z-index: 1000;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  color: #fff;
  background: rgba(7, 11, 20, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.photo-viewer-close:hover {
  color: #fff;
  background: var(--danger);
  border-color: transparent;
  filter: none;
  transform: none;
}

.photo-viewer-close:active {
  transform: scale(0.95);
}

.photo-viewer-close ion-icon {
  font-size: 1.5rem;
}

.photo-viewer-close svg {
  width: 22px;
  height: 22px;
}

body.viewer-open {
  overflow: hidden;
}

/* ---------------------------------------------
   Utilities
--------------------------------------------- */
.text-danger {
  color: var(--danger) !important;
}

.text-success {
  color: var(--success) !important;
}

/* ---------------------------------------------
   Animations
--------------------------------------------- */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(24px, -32px, 0) scale(1.06);
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}

/* ---------------------------------------------
   Responsive
--------------------------------------------- */
@media (max-width: 700px) {
  #content-area > header,
  #admin-dash-view > header {
    flex-direction: column;
    gap: 10px;
  }

  .composer-submit {
    width: 100%;
  }
}

@media (max-width: 560px) {
  #app {
    padding: 16px 14px 56px;
    gap: 20px;
  }

  #auth-view,
  #admin-login-view {
    min-height: calc(100dvh - 72px);
  }

  #auth-view > div,
  #admin-login-view > div {
    padding: 22px 18px;
  }

  #main-view > nav,
  #admin-dash-view > nav {
    top: 8px;
    padding: 8px;
  }

  #main-view > nav > div:first-child > span:last-child,
  #admin-dash-view > nav > div:first-child > span:last-child {
    display: none;
  }

  #main-view > nav > div:last-child,
  #admin-dash-view > nav > div:last-child {
    flex: 1;
    justify-content: flex-end;
  }

  #main-view > nav button,
  #admin-dash-view > nav button {
    padding: 9px 10px;
    font-size: 0.78rem;
  }

  #main-view > nav button span,
  #admin-dash-view > nav button span {
    display: none;
  }

  #main-view > nav button ion-icon,
  #admin-dash-view > nav button ion-icon {
    font-size: 1.15rem;
  }

  .card {
    padding: 14px;
    gap: 10px;
  }

  #content-area > header h2,
  #admin-dash-view > header h2 {
    font-size: 1.45rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  #background > span {
    animation: none;
  }
}
