:root{
  --cream:#fbf7ed; --paper:#fffdf8; --champagne:#f4e6c1; --gold:#c9a227;
  --deep:#282116; --muted:#7a6d5a; --line:#e7dcc2; --rose:#ead6cf; --green:#58704b;
  --red:#9b3c3c; --shadow:0 16px 45px rgba(67,52,25,.12); --radius:24px;
}
*{box-sizing:border-box}
html{background:linear-gradient(160deg,#fffaf0,#f7ead0);min-height:100%}
body{
  margin:0;color:var(--deep);
  font-family: ui-rounded, "SF Pro Rounded", "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:radial-gradient(circle at 15% 0%, rgba(201,162,39,.24), transparent 28rem),
             radial-gradient(circle at 90% 8%, rgba(234,214,207,.5), transparent 24rem),
             var(--cream);
}
button,input,select,textarea{font:inherit}
button{cursor:pointer}
a{color:inherit}
.app-shell{max-width:1180px;margin:0 auto;padding:18px 18px 110px}
.topbar{
  display:flex;align-items:center;justify-content:space-between;gap:16px;
  background:rgba(255,253,248,.72);border:1px solid rgba(201,162,39,.25);
  backdrop-filter: blur(16px);border-radius:28px;padding:18px 20px;margin:8px 0 14px;box-shadow:var(--shadow);
}
.eyebrow{text-transform:uppercase;letter-spacing:.16em;font-weight:900;color:var(--gold);font-size:.72rem;margin:0 0 4px}
h1{font-family: Georgia, "Times New Roman", serif;font-size:clamp(2rem,5vw,4rem);margin:0;line-height:.95}
h2,h3{margin:.2rem 0 .6rem}
.subtitle{margin:.3rem 0 0;color:var(--muted);font-weight:800}
.tabs{
  position:sticky;top:8px;z-index:10;display:flex;gap:8px;overflow:auto;padding:8px;
  background:rgba(255,253,248,.78);border:1px solid var(--line);border-radius:999px;box-shadow:0 10px 30px rgba(67,52,25,.08);
  backdrop-filter: blur(16px);
}
.tabs button{border:0;background:transparent;border-radius:999px;padding:11px 15px;color:var(--muted);font-weight:900;white-space:nowrap}
.tabs button.active{background:var(--deep);color:#fff}
.panel{display:none;padding:18px 0}
.panel.active{display:block}
.card{background:rgba(255,253,248,.88);border:1px solid var(--line);border-radius:var(--radius);padding:18px;box-shadow:var(--shadow)}
.hero-grid{display:grid;grid-template-columns:1.25fr .75fr;gap:16px}
.hero-card{min-height:260px;display:flex;flex-direction:column;justify-content:space-between;overflow:hidden;position:relative}
.hero-card:after{content:"";position:absolute;right:-80px;top:-80px;width:260px;height:260px;border-radius:50%;background:radial-gradient(circle,rgba(201,162,39,.22),transparent 65%)}
.hero-title{font-family:Georgia,"Times New Roman",serif;font-size:clamp(2rem,5vw,4.4rem);line-height:1;margin:.3rem 0}
.countdown{display:grid;grid-template-columns:1fr;gap:10px;margin-top:18px}
.countbox{background:linear-gradient(180deg,#fff,#f7ebd1);border:1px solid var(--line);border-radius:18px;text-align:center;padding:14px}
.big-countbox strong{font-size:clamp(1.8rem,5vw,3.4rem);font-family:Georgia,"Times New Roman",serif;display:block}
.countbox span{font-size:.75rem;color:var(--muted);font-weight:900;text-transform:uppercase;letter-spacing:.08em}
.phase{display:inline-flex;border:1px solid rgba(201,162,39,.35);background:var(--champagne);border-radius:999px;padding:8px 11px;font-weight:900;margin-top:8px}
.kpi-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin:16px 0}
.kpi{background:var(--paper);border:1px solid var(--line);border-radius:20px;padding:15px}
.kpi p{margin:0;color:var(--muted);font-size:.8rem;font-weight:900;text-transform:uppercase;letter-spacing:.07em}
.kpi strong{font-size:1.5rem;display:block;margin-top:6px}
.section-head{display:flex;justify-content:space-between;gap:12px;align-items:center;margin:8px 0 12px}
.section-head h2{margin:0;font-size:1.45rem}
.grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
.grid.two{grid-template-columns:repeat(2,minmax(0,1fr))}
.venue-card{position:relative;overflow:hidden}
.venue-card:before{content:"";position:absolute;inset:0 0 auto 0;height:7px;background:linear-gradient(90deg,var(--gold),#f0d98f,#fff)}
.badges{display:flex;flex-wrap:wrap;gap:7px;margin:10px 0}
.badge{font-size:.74rem;font-weight:900;color:var(--deep);background:var(--champagne);border:1px solid rgba(201,162,39,.28);border-radius:999px;padding:6px 9px}
.badge.green{background:#e8f0e2;color:#2d4723}
.badge.soft{background:#f6ece7}
.badge.red{background:#fff0f0;color:var(--red)}
.note{color:var(--muted);line-height:1.45}
.actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}
.primary,.secondary,.ghost,.danger{border-radius:999px;padding:10px 14px;font-weight:900;border:1px solid transparent}
.primary{background:var(--deep);color:#fff}
.secondary{background:var(--champagne);color:var(--deep);border-color:rgba(201,162,39,.35)}
.ghost{background:#fff;color:var(--deep);border-color:var(--line)}
.danger{background:#fff0f0;color:#883434;border-color:#f0cccc}
.hidden{display:none!important}
.filters{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:14px}
input,select,textarea{width:100%;background:#fff;border:1px solid var(--line);border-radius:16px;padding:11px 12px;color:var(--deep);outline:none}
textarea{min-height:90px;resize:vertical}
.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.form-grid .full{grid-column:1/-1}
.form-grid .third{grid-column:auto}
.table-wrap{overflow:auto;background:var(--paper);border:1px solid var(--line);border-radius:22px;box-shadow:var(--shadow)}
table{width:100%;border-collapse:collapse;min-width:820px}
th,td{padding:12px 14px;text-align:left;border-bottom:1px solid var(--line);vertical-align:top}
th{font-size:.76rem;text-transform:uppercase;letter-spacing:.08em;color:var(--muted);background:#fff8e8}
tr:last-child td{border-bottom:0}
.progress{height:12px;border-radius:999px;background:#efe4ca;overflow:hidden;border:1px solid var(--line)}
.progress > span{display:block;height:100%;background:linear-gradient(90deg,var(--gold),#e6c86f);width:0%}
.list{display:grid;gap:10px}
.list-row{display:flex;justify-content:space-between;gap:12px;align-items:flex-start;background:var(--paper);border:1px solid var(--line);border-radius:18px;padding:12px}
.list-row.done{opacity:.7}
.small{font-size:.84rem;color:var(--muted)}
.score-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:10px}
.checkbox-row{display:flex;gap:10px;align-items:flex-start}
.checkbox-row input{width:auto;margin-top:4px}
.table-card{border:1px solid var(--line);background:#fff;border-radius:20px;padding:14px}
.guest-pill{display:inline-flex;gap:6px;align-items:center;background:var(--champagne);border-radius:999px;padding:6px 9px;margin:4px;font-size:.84rem;font-weight:800}
.modal-backdrop{position:fixed;inset:0;z-index:100;background:rgba(24,18,10,.42);display:flex;align-items:flex-end;justify-content:center;padding:16px}
.modal-card{width:min(850px,100%);max-height:90vh;overflow:auto;background:var(--paper);border:1px solid var(--line);border-radius:28px;box-shadow:0 30px 70px rgba(0,0,0,.25)}
.modal-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:16px 18px;border-bottom:1px solid var(--line)}
.modal-head h2{margin:0}
.modal-body{padding:18px}
.icon-btn{width:38px;height:38px;border-radius:50%;border:1px solid var(--line);background:#fff;font-size:1.4rem}
.sync-card{display:grid;gap:12px}
.export-area{font-family:ui-monospace,Menlo,Consolas,monospace;font-size:.8rem;min-height:180px}
@media (max-width:900px){
  .hero-grid,.grid,.grid.two,.kpi-grid{grid-template-columns:1fr}
  .app-shell{padding:10px 10px 104px}
  .topbar{border-radius:22px}
  .tabs{position:fixed;left:10px;right:10px;bottom:10px;top:auto;justify-content:flex-start;padding:8px;border-radius:24px}
  .tabs button{padding:10px 12px;font-size:.88rem}
  .section-head{align-items:flex-start;flex-direction:column}
  .form-grid,.score-grid{grid-template-columns:1fr}
}


/* v2.6 iPhone 16 Pro Max / large mobile polish
   Viewport target: ~440px wide, tall safe-area display.
   Goals: no button text spill, clean card rhythm, better thumb targets, safe-area bottom nav. */

html{
  -webkit-text-size-adjust:100%;
  text-size-adjust:100%;
}

body{
  overflow-x:hidden;
}

button,
.primary,
.secondary,
.ghost,
.danger,
.icon-btn{
  -webkit-tap-highlight-color: transparent;
}

.primary,
.secondary,
.ghost,
.danger{
  min-height:44px;
  max-width:100%;
  white-space:normal;
  overflow-wrap:anywhere;
  word-break:normal;
  line-height:1.15;
  text-align:center;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
}

.actions{
  align-items:stretch;
}

.actions button{
  flex:1 1 140px;
  min-width:0;
}

.badge{
  max-width:100%;
  white-space:normal;
  overflow-wrap:anywhere;
  line-height:1.15;
}

.card,
.table-card,
.venue-card{
  min-width:0;
}

.card h2,
.card h3,
.venue-card h3,
.hero-title,
.note,
.small,
td,
th{
  overflow-wrap:anywhere;
}

input,
select,
textarea{
  font-size:16px; /* Prevents iOS Safari zooming form fields */
}

@media (max-width: 520px){
  :root{
    --radius:20px;
    --shadow:0 10px 28px rgba(67,52,25,.10);
  }

  .app-shell{
    width:100%;
    max-width:460px;
    padding:10px 10px calc(118px + env(safe-area-inset-bottom));
    margin:0 auto;
  }

  .topbar{
    padding:14px 14px;
    margin:6px 0 10px;
    border-radius:22px;
    align-items:flex-start;
  }

  .topbar .ghost{
    min-width:74px;
    padding:9px 11px;
    font-size:.86rem;
  }

  .eyebrow{
    font-size:.66rem;
    letter-spacing:.13em;
  }

  h1{
    font-size:clamp(2rem, 10vw, 2.75rem);
    line-height:.96;
  }

  .subtitle{
    font-size:.9rem;
  }

  .tabs{
    left:8px;
    right:8px;
    bottom:calc(8px + env(safe-area-inset-bottom));
    padding:7px;
    gap:6px;
    border-radius:22px;
    scrollbar-width:none;
    -webkit-overflow-scrolling:touch;
  }

  .tabs::-webkit-scrollbar{
    display:none;
  }

  .tabs button{
    flex:0 0 auto;
    min-width:72px;
    min-height:42px;
    padding:9px 11px;
    font-size:.78rem;
    line-height:1.05;
    white-space:normal;
    overflow-wrap:normal;
  }

  .panel{
    padding:12px 0;
  }

  .hero-grid,
  .grid,
  .grid.two,
  .kpi-grid{
    grid-template-columns:1fr;
    gap:12px;
  }

  .card,
  .table-card{
    padding:14px;
    border-radius:20px;
  }

  .hero-card{
    min-height:auto;
    gap:18px;
  }

  .hero-title{
    font-size:clamp(2rem, 10vw, 3rem);
  }

  .countbox{
    padding:13px 10px;
  }

  .big-countbox strong{
    font-size:clamp(1.65rem, 8vw, 2.35rem);
    line-height:1.05;
  }

  .phase{
    max-width:100%;
    white-space:normal;
    line-height:1.15;
  }

  .kpi{
    padding:13px;
    border-radius:18px;
  }

  .kpi strong{
    font-size:1.35rem;
  }

  .section-head{
    gap:8px;
    margin:6px 0 10px;
  }

  .section-head h2{
    font-size:1.18rem;
    line-height:1.15;
  }

  .section-head .primary,
  .section-head .secondary,
  .section-head .ghost{
    width:100%;
  }

  .filters{
    display:grid;
    grid-template-columns:1fr;
    gap:8px;
  }

  .venue-card{
    padding:15px;
  }

  .venue-card h3{
    font-size:1.05rem;
    line-height:1.16;
    margin-top:8px;
  }

  .badges{
    gap:6px;
  }

  .badge{
    font-size:.69rem;
    padding:6px 8px;
  }

  .note{
    font-size:.91rem;
    line-height:1.42;
  }

  .small{
    font-size:.78rem;
    line-height:1.35;
  }

  .actions{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:8px;
    width:100%;
  }

  .actions button,
  .actions .primary,
  .actions .secondary,
  .actions .ghost,
  .actions .danger{
    width:100%;
    min-width:0;
    padding:10px 9px;
    font-size:.82rem;
    min-height:46px;
  }

  .actions button:only-child{
    grid-column:1 / -1;
  }

  .primary.full,
  .secondary.full,
  .ghost.full,
  .danger.full,
  .form-grid .primary.full{
    width:100%;
  }

  .form-grid{
    grid-template-columns:1fr;
    gap:9px;
  }

  .form-grid .full,
  .form-grid .third{
    grid-column:1 / -1;
  }

  input,
  select,
  textarea{
    border-radius:14px;
    padding:11px 12px;
  }

  textarea{
    min-height:94px;
  }

  .table-wrap{
    border-radius:18px;
  }

  table{
    min-width:720px;
  }

  th,
  td{
    padding:10px 11px;
    font-size:.85rem;
  }

  .list{
    gap:8px;
  }

  .list-row{
    flex-direction:column;
    align-items:stretch;
    gap:10px;
    padding:11px;
    border-radius:16px;
  }

  .list-row .actions{
    grid-template-columns:1fr 1fr;
  }

  .checkbox-row{
    width:100%;
  }

  .guest-pill{
    max-width:100%;
    white-space:normal;
    overflow-wrap:anywhere;
    line-height:1.15;
  }

  .score-grid{
    grid-template-columns:1fr;
  }

  .modal-backdrop{
    padding:8px;
    padding-bottom:calc(8px + env(safe-area-inset-bottom));
    align-items:flex-end;
  }

  .modal-card{
    width:100%;
    max-height:88vh;
    border-radius:22px;
  }

  .modal-head{
    padding:13px 14px;
  }

  .modal-head h2{
    font-size:1.14rem;
    line-height:1.15;
  }

  .modal-body{
    padding:14px;
  }

  .modal-body .list button{
    justify-content:flex-start;
    text-align:left;
    min-height:56px;
  }

  .icon-btn{
    min-width:38px;
    flex:0 0 38px;
  }

  .export-area{
    font-size:.75rem;
  }
}

@media (min-width: 390px) and (max-width: 460px){
  .actions{
    grid-template-columns:1fr 1fr;
  }

  .tabs button{
    min-width:76px;
  }
}

@media (max-width: 360px){
  .actions{
    grid-template-columns:1fr;
  }

  .tabs button{
    min-width:68px;
    font-size:.74rem;
  }
}


/* v2.7 tools polish */
.update-banner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  background:linear-gradient(135deg,#fff8e8,#f4e6c1);
  border:1px solid rgba(201,162,39,.35);
  border-radius:20px;
  padding:12px 14px;
  margin:10px 0 12px;
  box-shadow:var(--shadow);
}
.update-banner p{margin:2px 0 0;color:var(--muted);font-size:.86rem}
.update-banner button{flex:0 0 auto}
.message-preview{white-space:pre-wrap}
@media (max-width:520px){
  .update-banner{
    align-items:stretch;
    flex-direction:column;
    border-radius:18px;
    padding:12px;
  }
  .update-banner button{width:100%}
}


/* v2.8 venue edit/visit de-duplication polish */
.modal-body h3{
  margin-top:10px;
}
@media (max-width:520px){
  .modal-body h3{
    font-size:1rem;
    line-height:1.15;
  }
}
