:root {
  --cream: #faf6ef;
  --surface: #ffffff;
  --surface-2: #f3ecdf;
  --ink: #2f2a24;
  --muted: #8a7f6f;
  --line: #e7ddcc;
  --green: #2f7d5b;
  --green-dk: #245f45;
  --amber: #e8a13a;
  --danger: #c0492f;
  --radius: 18px;
  --shadow: 0 6px 24px rgba(60, 44, 20, .10);
  font-synthesis: none;
}

* { box-sizing: border-box; }

html, body { margin: 0; height: 100%; }

body {
  background: var(--cream);
  color: var(--ink);
  font-family: ui-rounded, "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

#app {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 18px 80px;
}

/* --- header --- */
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.brand img { width: 40px; height: 40px; border-radius: 12px; }
.brand h1 { font-size: 1.5rem; margin: 0; letter-spacing: -.02em; }
.tagline { color: var(--muted); margin: 0 0 24px; font-size: .95rem; }

.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.topbar .who { font-weight: 600; }
.topbar .who small { display: block; color: var(--muted); font-weight: 400; font-size: .8rem; }

/* --- cards --- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.card h2 { margin: 0 0 14px; font-size: 1.05rem; letter-spacing: -.01em; }
.card h2 .hint { font-weight: 400; color: var(--muted); font-size: .82rem; }

.section-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 26px 4px 10px; }

/* --- list items --- */
.item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface); margin-bottom: 10px;
}
.item:last-child { margin-bottom: 0; }
.item .avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 700; color: #fff;
  background: var(--green); font-size: 1.05rem;
}
.item .grow { flex: 1; min-width: 0; }
.item .name { font-weight: 600; }
.item .sub { color: var(--muted); font-size: .82rem; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #cdbfa6; display: inline-block; }
.dot.on { background: #41b06e; box-shadow: 0 0 0 3px rgba(65,176,110,.2); }

.empty { color: var(--muted); text-align: center; padding: 18px; font-size: .92rem; }

/* --- forms / buttons --- */
label { display: block; font-size: .85rem; color: var(--muted); margin: 0 0 6px; }
input[type=text], input[type=email], input[type=date], select {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); color: var(--ink); font: inherit; margin-bottom: 12px;
}
input:focus, select:focus { outline: 2px solid var(--green); outline-offset: 1px; border-color: transparent; }

button {
  font: inherit; font-weight: 600; cursor: pointer; border: 0;
  border-radius: 12px; padding: 11px 16px; background: var(--green); color: #fff;
  transition: transform .04s ease, background .15s ease;
}
button:hover { background: var(--green-dk); }
button:active { transform: translateY(1px); }
button.ghost { background: var(--surface-2); color: var(--ink); }
button.ghost:hover { background: var(--line); }
button.amber { background: var(--amber); color: #3a2c10; }
button.amber:hover { background: #d8902b; }
button.danger { background: var(--danger); }
button.danger:hover { background: #a23a24; }
button.sm { padding: 8px 12px; font-size: .85rem; border-radius: 10px; }
button:disabled { opacity: .5; cursor: default; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; }

/* --- code / share --- */
.code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 1.6rem; letter-spacing: .12em;
  background: var(--surface-2); border: 1px dashed var(--line); border-radius: 12px;
  padding: 14px; text-align: center; user-select: all; margin-bottom: 12px;
}

/* --- toast --- */
#toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 12px;
  font-size: .9rem; box-shadow: var(--shadow); opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; max-width: 90vw; z-index: 50;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err { background: var(--danger); }

/* --- incoming call banner --- */
#incoming:empty { display: none; }
#incoming {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  width: min(520px, 92vw); background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; box-shadow: var(--shadow); padding: 14px 16px; z-index: 60;
  display: flex; align-items: center; gap: 12px; animation: drop .25s ease;
}
@keyframes drop { from { transform: translateX(-50%) translateY(-16px); opacity: 0; } }
#incoming .grow { flex: 1; }
#incoming .name { font-weight: 700; }
#incoming .sub { color: var(--muted); font-size: .85rem; }

/* --- call overlay --- */
#call:empty { display: none; }
#call { position: fixed; inset: 0; background: #0d1411; z-index: 100; display: flex; flex-direction: column; }
#call .bar { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; color: #fff; }
#call .bar .title { font-weight: 600; opacity: .9; }
#call rtk-meeting { flex: 1; width: 100%; }

.center-screen { min-height: 70vh; display: grid; place-items: center; }
.center-screen .card { width: min(440px, 100%); }
.muted { color: var(--muted); }
a.link { color: var(--green-dk); }
