:root {
  --green: #0b3a31;
  --green-2: #11493e;
  --green-3: #1b5d4f;
  --gold: #d6ad2b;
  --gold-hi: #f2d374;
  --gold-lo: #a8801a;
  --cream: #f7f2e7;
  --paper: #fffdf8;
  --ink: #1b2522;
  --muted: #6c7672;
  --line: #e8e0cd;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
html { background: var(--green); }
body {
  font-family: var(--sans); color: var(--ink); line-height: 1.45;
  -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%;
  min-height: 100vh;
  background: radial-gradient(900px 500px at 50% -20%, #17594b, transparent 70%), var(--green);
}
a { color: var(--green-3); }
.center-text { text-align: center; }
.ic { width: 20px; height: 20px; flex: 0 0 auto; }
.fine { font-size: 12px; color: var(--muted); }
.hint { font-size: 12.5px; color: var(--muted); margin: 8px 0 0; }
.err { font-size: 12.5px; color: #b42318; margin: 6px 0 0; }
.ok, .alert { padding: 11px 14px; border-radius: 12px; font-size: 13.5px; margin: 0 0 14px; }
.ok { background: #eef6ee; border: 1px solid #cfe5cf; color: #24513a; }
.alert { background: #fdecea; border: 1px solid #f5c2bd; color: #8a1c13; text-align: left; }

/* =============== LOGIN =============== */
.is-login { background: var(--green); }
.login-hero {
  min-height: 100vh; min-height: 100svh;
  background-size: cover; background-position: center bottom;
  position: relative; color: #fff;
}
.login-hero::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(6,32,27,.55) 0%, rgba(6,32,27,.25) 40%, rgba(6,32,27,.15) 60%, rgba(6,32,27,.85) 100%);
}
.login-inner {
  position: relative; max-width: 460px; margin: 0 auto; min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; padding: max(34px, env(safe-area-inset-top)) 26px 22px;
}
.login-logo { width: 118px; height: auto; filter: drop-shadow(0 2px 6px rgba(0,0,0,.35)); }
.login-copy { margin-top: 13vh; }
.login-copy h1 { font: 700 38px/1.08 var(--sans); letter-spacing: -.01em; margin: 0; text-shadow: 0 2px 18px rgba(0,0,0,.35); }
.login-sub { font-weight: 700; font-size: 18px; margin: 10px 0 0; }
.login-desc { font-size: 14.5px; color: rgba(255,255,255,.85); margin: 10px 0 26px; max-width: 300px; }
.btn-ms {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  background: var(--green); color: #fff; text-decoration: none;
  font: 600 15.5px var(--sans); padding: 16px; border-radius: 12px;
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: 0 14px 30px -12px rgba(0,0,0,.6);
  transition: transform .12s, background .15s;
}
.btn-ms:hover { background: var(--green-2); }
.btn-ms:active { transform: scale(.985); }
.login-note { font-size: 12.5px; color: rgba(255,255,255,.75); text-align: center; margin: 12px 0 0; }
.login-foot {
  margin-top: auto; padding-top: 30px; text-align: center; font-size: 11px; color: rgba(255,255,255,.7);
  display: flex; flex-direction: column; gap: 8px;
}
.login-foot .tagline { border-top: 2px solid var(--gold); padding-top: 14px; letter-spacing: .32em; font-weight: 600; color: #fff; }

/* =============== PORTAL =============== */
.ptop {
  max-width: 480px; margin: 0 auto;
  display: flex; align-items: center; gap: 12px;
  padding: max(14px, env(safe-area-inset-top)) 18px 16px; color: #fff;
}
.ptop-back { color: #fff; display: grid; place-items: center; width: 28px; height: 28px; margin-left: -6px; }
.ptop-back svg { width: 22px; height: 22px; }
.ptop-logo img { width: 66px; height: auto; display: block; }
.ptop-title { flex: 1; font-weight: 600; font-size: 17px; }
.ptop-me { text-decoration: none; }
.avatar { border-radius: 50%; object-fit: cover; display: inline-grid; place-items: center; background: var(--cream); color: var(--green); font-weight: 700; }
.avatar.sm { width: 36px; height: 36px; font-size: 13px; border: 2px solid rgba(255,255,255,.85); }
.avatar.lg { width: 104px; height: 104px; font-size: 34px; }
.avatar.xl { width: 128px; height: 128px; font-size: 42px; }
.avatar-ini { font-family: var(--sans); letter-spacing: .02em; }

.sheet {
  max-width: 480px; margin: 0 auto; min-height: calc(100vh - 70px);
  background: var(--cream); border-radius: 22px 22px 0 0;
  padding: 16px 16px 40px;
}
.tabs {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px;
  background: var(--paper); border-radius: 14px; padding: 5px;
  box-shadow: 0 1px 2px rgba(0,0,0,.05); margin-bottom: 20px;
}
.tabs a {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 9px 2px; border-radius: 10px; text-decoration: none;
  font-size: 11.5px; color: var(--ink); font-weight: 500;
}
.tabs svg { width: 22px; height: 22px; }
.tabs a.on { background: var(--green); color: #fff; }
.hello, .sheet-h { font: 700 26px/1.15 var(--serif); color: var(--ink); margin: 4px 2px 2px; }
.hello { font-size: 28px; }
.hello-sub { font-size: 13.5px; color: var(--muted); margin: 2px 2px 16px; }
.box {
  background: var(--paper); border-radius: 16px; padding: 22px 18px; margin-bottom: 14px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 10px 30px -18px rgba(0,0,0,.25);
}
.box .sheet-h { margin-top: 0; }

/* menu rows */
.menu { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.mrow {
  display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 13px 14px;
  transition: border-color .15s, transform .12s;
}
.mrow:hover { border-color: var(--gold); }
.mrow:active { transform: scale(.99); }
.mrow-ic { width: 44px; height: 44px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; flex: 0 0 44px; }
.mrow-ic .ic { width: 20px; height: 20px; }
.mrow-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mrow-txt strong { font-size: 14.5px; font-weight: 600; }
.mrow-txt small { font-size: 12px; color: var(--muted); }
.mrow > .ic:last-child { width: 18px; height: 18px; color: var(--muted); }

/* printed card */
.card-link { display: block; text-decoration: none; color: inherit; }
.namecard {
  background: var(--paper); border-radius: 14px; overflow: hidden; position: relative;
  box-shadow: 0 2px 4px rgba(0,0,0,.05), 0 18px 34px -18px rgba(11,58,49,.55);
  border: 1px solid #efe7d4;
}
.namecard::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(135deg, transparent 74%, rgba(214,173,43,.10) 74%, rgba(214,173,43,.10) 74.8%, transparent 74.8%);
}
.nc-front { display: flex; align-items: center; gap: 16px; padding: 18px 18px 16px; }
.nc-brand {
  flex: 0 0 auto; width: 92px; height: 82px; border-radius: 12px; background: #fff;
  display: grid; place-items: center; box-shadow: 0 4px 14px -6px rgba(0,0,0,.25);
}
.nc-logo { width: 70px; height: auto; }
.nc-who { min-width: 0; }
.nc-name { font: 700 24px/1.08 var(--serif); margin: 0; color: var(--ink); }
.nc-title { margin: 7px 0 0; font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-lo); }
.nc-dept { margin: 3px 0 0; font-size: 12.5px; color: var(--muted); }
.nc-co { margin: 2px 0 0; font-size: 12.5px; font-weight: 600; color: var(--green-3); }
textarea { width: 100%; padding: 13px 14px; border: 1px solid #ddd5c1; border-radius: 11px; font: 16px/1.4 var(--sans); background: #fff; color: var(--ink); resize: vertical; }
textarea:focus, select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(214,173,43,.2); }
select { width: 100%; padding: 13px 14px; border: 1px solid #ddd5c1; border-radius: 11px; font: 16px var(--sans); background: #fff; color: var(--ink); }
.form h3 { font: 700 19px var(--serif); margin: 26px 0 0; padding-top: 16px; border-top: 1px solid var(--line); }
.nc-foot {
  background: var(--green); color: #fff; text-align: center; font-size: 12.5px; letter-spacing: .04em;
  padding: 10px; border-top: 2px solid var(--gold);
}

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px 18px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--paper); color: var(--ink); text-decoration: none; cursor: pointer;
  font: 600 14.5px var(--sans); transition: transform .12s, border-color .15s, filter .15s;
}
.btn:active { transform: scale(.985); }
.btn .ic { width: 19px; height: 19px; }
.btn.line:hover { border-color: var(--gold); }
.btn.gold {
  background: linear-gradient(180deg, var(--gold-hi), var(--gold) 60%, #c79d22);
  border-color: #c99f24; color: #2a2006;
  box-shadow: 0 8px 18px -10px rgba(168,128,26,.9), inset 0 1px 0 rgba(255,255,255,.5);
}
.btn.gold:hover { filter: brightness(1.04); }
.btn.wide, .stack .btn { width: 100%; }
.actions { display: flex; gap: 10px; margin-top: 20px; }
.actions .btn { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }

/* forms */
.form label { display: block; font-weight: 600; font-size: 12.5px; color: var(--ink); margin: 16px 0 6px; }
input[type=text], input[type=tel] {
  width: 100%; padding: 13px 14px; border: 1px solid #ddd5c1; border-radius: 11px;
  font: 16px var(--sans); background: #fff; color: var(--ink);
}
input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(214,173,43,.2); }
input:disabled { background: #f2ede1; color: var(--muted); }

/* QR & share */
.qr-frame {
  position: relative; width: 230px; max-width: 72%; margin: 18px auto 20px; padding: 12px;
  background:
    linear-gradient(var(--gold), var(--gold)) top left / 34px 3px,
    linear-gradient(var(--gold), var(--gold)) top left / 3px 34px,
    linear-gradient(var(--gold), var(--gold)) top right / 34px 3px,
    linear-gradient(var(--gold), var(--gold)) top right / 3px 34px,
    linear-gradient(var(--gold), var(--gold)) bottom left / 34px 3px,
    linear-gradient(var(--gold), var(--gold)) bottom left / 3px 34px,
    linear-gradient(var(--gold), var(--gold)) bottom right / 34px 3px,
    linear-gradient(var(--gold), var(--gold)) bottom right / 3px 34px;
  background-repeat: no-repeat;
}
.qr-frame canvas { width: 100%; height: auto; display: block; border-radius: 6px; }
.linkbox {
  display: flex; align-items: center; gap: 8px; text-align: left;
  border: 1px solid var(--line); background: #fff; border-radius: 11px; padding: 6px 6px 6px 14px;
}
.linkbox span { flex: 1; min-width: 0; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.linkbox button { border: 0; background: transparent; color: var(--ink); padding: 8px; border-radius: 8px; cursor: pointer; display: grid; }
.linkbox button:hover { background: var(--cream); }
.toast { height: 0; margin: 0; opacity: 0; font-size: 13px; color: var(--green-3); transition: opacity .2s; }
.toast.show { opacity: 1; height: auto; margin-top: 10px; }
.tip {
  background: linear-gradient(160deg, #efe6d1, #e6dabd); border-radius: 16px; padding: 18px 16px 14px;
}
.tip .namecard { transform: rotate(-2deg) scale(.92); transform-origin: center; }
.tip p { font-size: 13px; color: #4a4636; margin: 14px 4px 0; }

/* projects picker */
.pick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pick-item {
  position: relative; display: block; background: var(--paper); border-radius: 14px; overflow: hidden; cursor: pointer;
  border: 2px solid transparent; box-shadow: 0 1px 2px rgba(0,0,0,.06);
}
.pick-item input { position: absolute; opacity: 0; }
.pick-item:has(input:checked) { border-color: var(--gold); }
.pick-name { display: block; padding: 10px 12px; font-size: 13.5px; font-weight: 600; }
.pick-tick {
  position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; border-radius: 50%;
  background: rgba(255,255,255,.85); border: 2px solid #fff;
}
.pick-item input:checked ~ .pick-tick { background: var(--gold) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12l4 4 8-8' fill='none' stroke='%232a2006' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/16px no-repeat; }
.tile-img { display: block; aspect-ratio: 16 / 10; background-size: cover; background-position: center; background-color: var(--green-2); }
.tile-img.ph { background-position: center bottom; }

/* profile */
.avatar-xl-wrap { margin: 4px auto 12px; width: max-content; line-height: 0; border-radius: 50%; padding: 4px; background: linear-gradient(135deg, var(--gold-hi), var(--gold-lo)); }
.avatar-xl-wrap .avatar { border: 3px solid #fff; display: grid; box-sizing: border-box; line-height: 1; }
.file-btn.busy { opacity: .7; pointer-events: none; }
.file-btn { position: relative; overflow: hidden; width: 100%; margin-bottom: 10px; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.box form + form .btn { width: 100%; }

/* settings */
.switch-row {
  display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); cursor: pointer;
}
.switch-row span { flex: 1; display: flex; flex-direction: column; }
.switch-row strong { font-size: 14.5px; }
.switch-row small { font-size: 12.5px; color: var(--muted); }
.switch-row input { position: absolute; opacity: 0; }
.switch-row i { width: 46px; height: 28px; border-radius: 99px; background: #d7d0bf; position: relative; transition: background .2s; flex: 0 0 46px; }
.switch-row i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s; }
.switch-row input:checked + i { background: var(--green); }
.switch-row input:checked + i::after { transform: translateX(18px); }
.switch-row input:focus-visible + i { box-shadow: 0 0 0 3px rgba(214,173,43,.4); }

/* help */
.faq details { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 10px; padding: 0 16px; }
.faq summary { cursor: pointer; padding: 15px 0; font-weight: 600; font-size: 14.5px; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
.faq summary::after { content: "+"; color: var(--gold-lo); font-size: 20px; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq p { margin: 0 0 15px; font-size: 13.5px; color: #4b5552; }

/* =============== PUBLIC CARD =============== */
.pub { max-width: 480px; margin: 0 auto; }
.pub-top {
  position: relative; height: 210px; background-size: cover; background-position: center 70%;
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: max(18px, env(safe-area-inset-top)) 18px 0;
}
.pub-top::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(8,46,39,.95) 0%, rgba(8,46,39,.75) 45%, rgba(8,46,39,.15) 100%); }
.pub-logo { position: relative; width: 98px; height: auto; }
.pub-tag { position: relative; color: #fff; font-size: 9.5px; letter-spacing: .26em; font-weight: 600; margin-top: 8px; }
.pub-sheet {
  position: relative; margin-top: -54px; background: var(--cream); border-radius: 22px 22px 0 0;
  padding: 0 18px 30px; min-height: 60vh;
}
.pub-id { display: flex; align-items: flex-end; gap: 16px; }
.pub-photo {
  margin-top: -40px; flex: 0 0 auto; border-radius: 50%; padding: 4px;
  background: linear-gradient(135deg, var(--gold-hi), var(--gold-lo)); box-shadow: 0 10px 24px -10px rgba(0,0,0,.5);
}
.pub-photo { line-height: 0; }
.pub-photo .avatar { border: 3px solid #fff; display: grid; box-sizing: border-box; line-height: 1; }
.pub-who { padding: 14px 0 0; min-width: 0; }
.pub-who h1 { font: 700 27px/1.05 var(--serif); margin: 0; color: var(--ink); }
.acts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 22px 0 18px; }
.acts .act { display: flex; flex-direction: column; align-items: center; gap: 7px; text-decoration: none; color: var(--ink); font-size: 12px; font-weight: 500; }
.acts .act span {
  width: 54px; height: 54px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center;
  box-shadow: 0 8px 18px -8px rgba(11,58,49,.8); transition: transform .12s, background .15s;
}
.acts .act:hover span { background: var(--green-3); }
.acts .act:active span { transform: scale(.94); }
.acts .ic { width: 23px; height: 23px; }
.dlist { list-style: none; margin: 0; padding: 4px 14px; background: var(--paper); border-radius: 16px; border: 1px solid var(--line); }
.dlist li + li { border-top: 1px solid #f0eadb; }
.dlist a { display: flex; gap: 14px; align-items: flex-start; padding: 11px 0; color: var(--ink); text-decoration: none; font-size: 14px; }
.dlist a:hover span { color: var(--green-3); text-decoration: underline; }
.dlist .ic { color: var(--ink); width: 19px; height: 19px; margin-top: 1px; }
.dev-head { display: flex; justify-content: space-between; align-items: baseline; margin: 24px 2px 12px; }
.dev-head h2 { font-size: 17px; font-weight: 700; margin: 0; }
.dev-head a { color: var(--gold-lo); font-size: 13px; font-weight: 600; text-decoration: none; }
.devs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dev { background: var(--paper); border-radius: 12px; overflow: hidden; text-decoration: none; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.06); transition: transform .15s; }
.dev:hover { transform: translateY(-2px); }
.dev-name { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 9px 10px; font-size: 13px; font-weight: 600; }
.dev-name .ic { width: 15px; height: 15px; color: var(--muted); }
.pub-sheet .fine { margin-top: 26px; }

@media (min-width: 520px) {
  .sheet, .pub-sheet { border-radius: 22px; margin-bottom: 30px; min-height: 0; }
}
@media (prefers-reduced-motion: no-preference) {
  .namecard, .menu, .box, .pub-sheet { animation: rise .55s cubic-bezier(.2,.7,.2,1) both; }
  .menu { animation-delay: .06s; }
}
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.tip .namecard { animation: none; }
/* social links */
.social { display: flex; align-items: center; gap: 8px; margin: 16px 2px 0; flex-wrap: wrap; }
.social > span { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-right: 4px; }
.social a { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 99px; background: var(--paper); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: 13px; font-weight: 600; transition: border-color .15s; }
.social a:hover { border-color: var(--gold); }
.social svg { width: 17px; height: 17px; }
.social .so-instagram svg { color: #c13584; }
.social .so-facebook svg { color: #1877f2; }