:root{
  --navy:#0A2540;
  --navy-2:#123A5E;
  --teal:#14B8A6;
  --teal-dark:#0E9C93;
  --teal-soft:#E6F7F5;
  --ink:#0F1B2A;
  --muted:#5B6B7C;
  --line:#E2EAF0;
  --bg:#F4F8FA;
  --white:#fff;
  --red:#D64545;
  --radius:18px;
  --shadow:0 6px 20px rgba(10,37,64,.07);
  --nav-h:64px;
}

*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{
  margin:0;
  background:var(--bg);
  color:var(--ink);
  font-family:"Segoe UI","Noto Kufi Arabic","Tahoma",system-ui,-apple-system,"Helvetica Neue",Arial,sans-serif;
  font-size:16px;
  line-height:1.65;
  padding-bottom:calc(var(--nav-h) + env(safe-area-inset-bottom) + 12px);
  overflow-x:hidden;
}
h1,h2,h3,p,ul,ol{margin:0}
a{color:inherit;text-decoration:none}
button{font-family:inherit}
[hidden]{display:none!important}

/* ============ header ============ */
.tp-header{
  position:sticky;top:0;z-index:40;
  display:flex;align-items:center;justify-content:space-between;gap:10px;
  padding:12px 16px calc(12px + env(safe-area-inset-top,0px)/3);
  padding-top:calc(12px + env(safe-area-inset-top,0px));
  background:linear-gradient(135deg,var(--navy) 0%,var(--navy-2) 100%);
  color:#fff;
  box-shadow:0 2px 12px rgba(10,37,64,.18);
}
.tp-brand{display:flex;align-items:center;gap:10px;min-width:0}
.tp-mark{width:38px;height:38px;flex:0 0 38px}
.tp-brand-text{display:flex;flex-direction:column;line-height:1.2;min-width:0}
.tp-name{font-size:20px;font-weight:700;letter-spacing:.2px}
.tp-tag{font-size:11px;color:#9FD8D3;font-weight:600}
.tp-sos{
  display:flex;align-items:center;gap:6px;
  background:var(--red);color:#fff;
  border-radius:999px;padding:7px 13px;
  font-weight:700;box-shadow:0 4px 12px rgba(214,69,69,.35);
  flex:0 0 auto;
}
.tp-sos-num{font-size:16px}
.tp-sos-label{font-size:12px;opacity:.95}

/* ============ layout ============ */
main{max-width:520px;margin:0 auto;padding:14px 14px 8px}
.tp-screen{display:none}
.tp-screen.is-active{display:block;animation:tp-in .22s ease}
@keyframes tp-in{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}

.tp-hero{
  background:linear-gradient(160deg,#fff 0%,#F0FAF8 100%);
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:18px 16px;
  box-shadow:var(--shadow);
  margin-bottom:16px;
}
.tp-hero h1{font-size:23px;line-height:1.35;color:var(--navy);font-weight:700}
.tp-hero p{font-size:14px;color:var(--muted);margin-top:6px}
.tp-hero-timer{background:linear-gradient(160deg,#0A2540 0%,#123A5E 100%);border-color:transparent}
.tp-hero-timer h1{color:#fff}
.tp-hero-timer p{color:#A9C4D8}

.tp-cta{
  display:flex;align-items:center;justify-content:center;gap:8px;
  margin-top:14px;padding:13px 16px;
  background:var(--teal);color:#fff;border-radius:14px;
  font-weight:700;font-size:15px;
  box-shadow:0 6px 16px rgba(20,184,166,.28);
}
.tp-cta svg{width:20px;height:20px;flex:0 0 20px}

.tp-h2{font-size:16px;color:var(--navy);font-weight:700;margin:2px 2px 10px}
.tp-h3{font-size:16px;color:var(--navy);font-weight:700;display:flex;align-items:center;gap:8px;margin-bottom:8px}
.tp-h3 svg{width:20px;height:20px;flex:0 0 20px}

/* ============ burn types ============ */
.tp-types{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:16px}
.tp-type{
  display:flex;flex-direction:column;align-items:flex-start;gap:8px;
  background:#fff;border:1.5px solid var(--line);border-radius:16px;
  padding:13px 12px;text-align:right;cursor:pointer;
  box-shadow:0 3px 10px rgba(10,37,64,.04);
  transition:border-color .15s,transform .12s;
  min-height:96px;
}
.tp-type:active{transform:scale(.985)}
.tp-type.is-selected{border-color:var(--teal);background:var(--teal-soft);box-shadow:0 6px 18px rgba(20,184,166,.18)}
.tp-type-ico{width:34px;height:34px;display:grid;place-items:center;background:var(--teal-soft);border-radius:11px;color:var(--teal-dark)}
.tp-type.is-selected .tp-type-ico{background:#fff}
.tp-type-ico svg{width:21px;height:21px}
.tp-type-name{font-size:14.5px;font-weight:700;color:var(--navy);line-height:1.35}

/* ============ detail ============ */
.tp-detail{margin-bottom:16px}
.tp-detail-head{
  display:flex;align-items:center;gap:10px;
  background:var(--navy);color:#fff;border-radius:16px 16px 0 0;padding:14px 16px;
}
.tp-detail-head h2{font-size:17px;font-weight:700}
.tp-detail-body{background:#fff;border:1px solid var(--line);border-top:0;border-radius:0 0 16px 16px;padding:16px}
.tp-steps{padding-inline-start:0;list-style:none;counter-reset:st}
.tp-steps li{
  counter-increment:st;position:relative;
  padding-inline-start:38px;margin-bottom:12px;font-size:15px;color:#22384d;
}
.tp-steps li:last-child{margin-bottom:0}
.tp-steps li::before{
  content:counter(st);
  position:absolute;inset-inline-start:0;top:1px;
  width:26px;height:26px;border-radius:9px;
  background:var(--teal-soft);color:var(--teal-dark);
  font-weight:700;font-size:13px;
  display:grid;place-items:center;
}
.tp-dont{
  margin-top:16px;background:#FEF3F2;border:1px solid #F7D4D0;border-radius:14px;padding:13px 14px;
}
.tp-dont h3{font-size:14.5px;color:#9B2C2C;font-weight:700;margin-bottom:6px}
.tp-dont ul{padding-inline-start:18px;margin:0;font-size:14px;color:#7A2E2E}
.tp-dont li{margin-bottom:4px}
.tp-type-note{
  margin-top:14px;background:#EFF6FF;border:1px solid #D6E6F7;border-radius:12px;
  padding:11px 13px;font-size:13.5px;color:#1E3A5F;
}

/* ============ cards ============ */
.tp-card{
  background:#fff;border:1px solid var(--line);border-radius:var(--radius);
  padding:16px;margin-bottom:16px;box-shadow:var(--shadow);
}
.tp-card.tp-muted{background:#F8FAFB;box-shadow:none}
.tp-card.tp-muted p{font-size:13.5px;color:var(--muted);margin-bottom:8px}
.tp-alert{background:#FFF9F2;border-color:#F3E0C6}
.tp-alert .tp-h3{color:#8A5A17}
.tp-alert ul{padding-inline-start:18px;font-size:14.5px;color:#5C4416;margin-bottom:12px}
.tp-alert li{margin-bottom:5px}
.tp-list{padding-inline-start:18px;font-size:14.5px;color:#2A3F53}
.tp-list li{margin-bottom:7px}
.tp-sources a{color:var(--teal-dark);text-decoration:underline;word-break:break-word}
.tp-version{font-size:12px;color:#8A9AA8;margin:0}

.tp-hint{font-size:13px;color:var(--muted);margin:0 2px 12px}

/* ============ buttons ============ */
.tp-btn{
  display:block;width:100%;text-align:center;
  padding:14px 16px;border-radius:14px;border:1.5px solid transparent;
  font-size:15.5px;font-weight:700;cursor:pointer;
  min-height:52px;
}
.tp-btn-primary{background:var(--teal);color:#fff;box-shadow:0 6px 16px rgba(20,184,166,.26)}
.tp-btn-primary:active{background:var(--teal-dark)}
.tp-btn-ghost{background:#fff;color:var(--navy);border-color:var(--line);margin-top:10px}

/* ============ timer ============ */
.tp-timer-card{
  background:#fff;border:1px solid var(--line);border-radius:var(--radius);
  padding:18px 16px 20px;margin-bottom:16px;box-shadow:var(--shadow);text-align:center;
}
.tp-ring-wrap{position:relative;width:min(68vw,240px);margin:0 auto 14px;aspect-ratio:1/1}
.tp-ring{width:100%;height:100%;display:block}
.tp-time{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px}
.tp-time-num{font-size:40px;font-weight:700;color:var(--navy);font-variant-numeric:tabular-nums;letter-spacing:1px}
.tp-time-state{font-size:13px;color:var(--muted);font-weight:600}
.tp-timer-actions{margin-top:4px}
.tp-timer-note{font-size:13.5px;color:var(--muted);margin-top:14px;line-height:1.6}
.tp-timer-note strong{color:var(--navy)}
.is-running .tp-ring circle#ringProgress{stroke:var(--teal)}
.is-done .tp-time-num{color:var(--teal-dark)}
.is-done .tp-timer-card{background:#F1FBF9;border-color:#BFEDE7}

/* ============ centers ============ */
.tp-call-row{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:12px}
.tp-call{
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;
  padding:14px 10px;border-radius:16px;color:#fff;min-height:84px;
}
.tp-call-red{background:linear-gradient(160deg,#E05252,#C23333);box-shadow:0 6px 16px rgba(214,69,69,.25)}
.tp-call-navy{background:linear-gradient(160deg,#123A5E,#0A2540)}
.tp-call-num{font-size:22px;font-weight:700}
.tp-call-label{font-size:12.5px;opacity:.92}

.tp-centers{list-style:none;padding:0;margin:0 0 16px;display:flex;flex-direction:column;gap:10px}
.tp-center{
  background:#fff;border:1px solid var(--line);border-radius:16px;padding:13px 14px;
  box-shadow:0 3px 10px rgba(10,37,64,.04);
  display:flex;align-items:center;justify-content:space-between;gap:10px;
}
.tp-center-info{min-width:0}
.tp-center-name{font-size:15px;font-weight:700;color:var(--navy);line-height:1.35}
.tp-center-area{font-size:12.5px;color:var(--muted);margin-top:2px}
.tp-center-go{
  flex:0 0 auto;display:flex;align-items:center;gap:5px;
  background:var(--teal-soft);color:var(--teal-dark);
  border-radius:12px;padding:10px 12px;font-size:13px;font-weight:700;
}
.tp-center-go svg{width:16px;height:16px}

/* ============ child ============ */
.tp-child-card{
  background:#fff;border:1px solid var(--line);border-radius:var(--radius);
  padding:16px;margin-bottom:16px;box-shadow:var(--shadow);text-align:center;
}
.tp-child-figure{width:min(52vw,180px);height:auto;display:block;margin:0 auto 6px}
.tp-story{min-height:96px;display:flex;align-items:center;justify-content:center;padding:4px 2px 10px}
.tp-story-line{font-size:16px;color:#22384d;line-height:1.7}
.tp-breath{text-align:center}
.tp-breath-circle{
  width:min(46vw,160px);aspect-ratio:1/1;border-radius:50%;
  margin:10px auto 14px;display:grid;place-items:center;
  background:radial-gradient(circle at 50% 40%,#DFF6F3,#BFEDE7);
  color:var(--navy);font-weight:700;font-size:15px;
  transition:transform 4s ease-in-out,background .4s;
}
.tp-breath-circle.is-in{transform:scale(1.12);background:radial-gradient(circle at 50% 40%,#CDEFEA,#A9E4DC)}
.tp-breath-circle.is-out{transform:scale(.88)}

/* ============ nav ============ */
.tp-nav{
  position:fixed;bottom:0;inset-inline:0;z-index:50;
  display:grid;grid-template-columns:repeat(5,1fr);
  background:rgba(255,255,255,.97);
  border-top:1px solid var(--line);
  padding-bottom:env(safe-area-inset-bottom);
  backdrop-filter:blur(8px);
}
.tp-nav-item{
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;
  padding:9px 2px 8px;color:#8496A6;font-size:11px;font-weight:600;min-height:var(--nav-h);
}
.tp-nav-item svg{width:22px;height:22px}
.tp-nav-item.is-active{color:var(--teal-dark)}
.tp-nav-item.is-active svg{color:var(--teal-dark)}

@media (min-width:430px){
  .tp-types{grid-template-columns:1fr 1fr 1fr}
}
@media (prefers-reduced-motion:reduce){
  *{animation:none!important;transition:none!important}
}
