:root {
  --bg: #081a31;
  --surface: #0d2340;
  --surface-2: #14305a;
  --border: #24426c;
  --text: #e8eaed;
  --muted: #9aa0b0;
  --accent: #6c8cff;
  --radius: 14px;
}

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

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding-bottom: 80px;
}

header {
  position: sticky;
  top: 0;
  background: rgba(8,26,49,0.92);
  backdrop-filter: blur(12px);
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--border);
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header h1 { font-size: 1.25rem; font-weight: 700; }
header { gap: .6rem; padding-top: calc(1rem + env(safe-area-inset-top)); }
.head-title { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; min-width: 0; }
.count { font-size: .85rem; color: var(--muted); }
.hint { font-size: .8rem; color: var(--muted); text-align: center; margin-top: .2rem; }
.idea img { display: block; max-width: 100%; border-radius: 8px; margin-top: .6rem; }
.idea .secondary { margin-top: .6rem; padding: .6rem; font-size: .85rem; min-height: 44px; }
.toast { position: fixed; left: 50%; bottom: calc(5.5rem + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--surface-2); border: 1px solid var(--border); color: var(--text); padding: .7rem 1rem; border-radius: 10px; font-size: .9rem; z-index: 30; max-width: calc(100vw - 2rem); }
html { -webkit-text-size-adjust: 100%; }
body { overflow-x: hidden; }
@media (max-width: 359px) { .container { padding: .9rem; } .install-btn { padding: .5rem .7rem; font-size: .8rem; } }

.container { padding: 1.2rem; max-width: 480px; margin: 0 auto; }

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.2rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
}

label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.4rem; color: var(--muted); }

input, select, textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.9rem;
  border-radius: 10px;
  font-size: 1rem;
  margin-bottom: 1rem;
}

textarea { min-height: 120px; resize: vertical; }

button {
  width: 100%;
  background: var(--accent);
  color: white;
  border: none;
  padding: 1rem;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 0.6rem;
}

button.secondary { background: var(--surface-2); border: 1px solid var(--border); }

.idea {
  background: var(--surface);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 0.8rem;
  border: 1px solid var(--border);
}

.idea-meta { font-size: 0.75rem; color: var(--muted); margin-bottom: 0.4rem; }
.idea-text { font-size: 0.95rem; line-height: 1.45; white-space: pre-wrap; }

.fab {
  position: fixed;
  bottom: calc(1.2rem + env(safe-area-inset-bottom));
  right: 1.2rem;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  border: none;
  font-size: 1.8rem;
  box-shadow: 0 6px 20px rgba(108,140,255,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
}

.empty { text-align: center; color: var(--muted); padding: 2rem 0; }

/* Select leggibili anche su iPhone (Safari disegna i select chiari) e font coerente */
input, select, textarea, button { font-family: inherit; }
select {
  -webkit-appearance: none; appearance: none;
  background-color: var(--surface-2);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%239aa0b0' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .9rem center; padding-right: 2.4rem;
  color: var(--text);
}
select option { background: #14305a; color: #e8eaed; }
input[type=file] { font-size: .9rem; }

/* Sezioni a schede sul telefono (barra in basso). Da 900px tutto visibile come prima. */
.info-panel { display: none; }
.only-mobile { display: none; }
.info-panel h2 { font-size: 1.1rem; margin-bottom: .5rem; }
.info-panel p { font-size: .95rem; line-height: 1.55; margin-bottom: .8rem; }
.info-list { font-size: .9rem; line-height: 1.55; color: var(--muted); padding-left: 1.1rem; margin-bottom: 1rem; }
.info-list li { margin-bottom: .3rem; }
@media (max-width: 899px) {
  .info-panel { display: block; }
  .only-mobile { display: inline-flex; }
  .only-wide { display: none; }
  .fab { display: none; }
  body:not([data-tab="nuova"]) [data-tab="nuova"],
  body:not([data-tab="idee"]) [data-tab="idee"],
  body:not([data-tab="info"]) [data-tab="info"] { display: none !important; }
  .empty-link { align-items: center; min-height: 44px; margin-top: .8rem; padding: 0 1.1rem; border-radius: 999px; background: var(--accent); color: #fff; font-weight: 600; text-decoration: none; }
  .pigi-footer { border-top: 0; }
  .toast { bottom: calc(88px + env(safe-area-inset-bottom)); }
}
