/* Marton Crystal Studio – az arculati kézikönyv 3.0 szerint
   Színek: csak a két márkakék és párjaik. Betű: csak Raleway. Emoji nincs. */
:root {
  --navy: #024A6E;
  --crystal: #018ACF;
  --action: #0074B0;
  --deep: #06324B;
  --ice: #EEF7FC;
  --mist: #D9E6EE;
  --ink: #1C2B36;
  --muted: #5D6F7C;
  --sky: #208ACB;
  --white: #FFFFFF;
  --radius: 14px;
  --nav-h: 76px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--white); color: var(--ink); }
body {
  font-family: Raleway, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--action); }
a:hover { color: var(--navy); }
button { font-family: inherit; }

.page { max-width: 560px; margin: 0 auto; padding: 24px 20px calc(var(--nav-h) + var(--safe-bottom) + 96px); }

/* Fejléc */
.brandbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.brandbar .mark { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brandbar .mark img { width: 132px; height: auto; }  /* fő logó, a kézikönyv szerint min. 120 px */
.brandbar img { height: 36px; width: auto; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 0.3em; text-transform: uppercase; color: var(--action); }
.meta { font-size: 11px; letter-spacing: 0.12em; color: var(--muted); }
h1 { margin: 14px 0 4px; font-weight: 700; font-size: 34px; line-height: 1.08; color: var(--navy); }
h1 .thin { font-weight: 300; }
h2 { margin: 28px 0 10px; font-size: 11px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.sub { font-size: 14px; color: var(--muted); }

/* Kártyák */
.card { border: 1px solid var(--mist); border-radius: var(--radius); background: var(--ice); padding: 14px; }
.card + .card { margin-top: 14px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 14px; }
.when { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.title { font-weight: 600; font-size: 20px; line-height: 1.2; color: var(--navy); text-decoration: none; }
.pillar { font-size: 12px; color: var(--crystal); }
.chips { display: flex; gap: 5px; flex-wrap: wrap; }
.chip { font-size: 10px; font-weight: 600; letter-spacing: 0.06em; color: var(--action); border: 1px solid var(--mist); border-radius: 6px; padding: 2px 6px; background: var(--white); }
.thumb {
  flex-shrink: 0; width: 76px; height: 100px; border-radius: 10px; background: var(--deep);
  display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative;
}
.thumb svg.bubbles { position: absolute; inset: 0; }
.excerpt { font-size: 13px; color: var(--ink); white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.status { font-size: 13px; color: var(--action); }
.status.muted { color: var(--muted); }
.status.error { color: var(--deep); font-weight: 600; }
.dim { opacity: 0.55; }

/* Gombok */
.btn {
  min-height: 44px; border-radius: 10px; border: 1px solid var(--mist); background: var(--white); color: var(--ink);
  font: 500 14px Raleway, sans-serif; padding: 0 14px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
}
.btn.primary { background: var(--action); border-color: var(--action); color: var(--white); font-weight: 600; }
.btn.primary:hover { background: var(--navy); color: var(--white); }
.btn.dark { background: var(--deep); border-color: var(--deep); color: var(--white); font-weight: 600; }
.btn.link { border: 0; background: none; color: var(--action); padding: 0 4px; min-height: 36px; }
.btn.quiet { color: var(--muted); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.btn-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.full { width: 100%; }

/* Haladás */
.progress { height: 4px; border-radius: 4px; background: var(--mist); overflow: hidden; }
.progress > div { height: 4px; background: var(--action); }

/* Űrlapok */
label.field { display: block; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
textarea, input[type=text], input[type=password], input[type=datetime-local], input[type=number] {
  width: 100%; border: 1px solid var(--mist); border-radius: 12px; background: var(--white); color: var(--ink);
  font: 400 15px Raleway, sans-serif; padding: 12px; line-height: 1.5;
}
textarea:focus, input:focus { outline: 2px solid var(--crystal); outline-offset: 1px; }
.pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  min-height: 40px; padding: 0 14px; border-radius: 20px; border: 1px solid var(--mist); background: none; color: var(--muted);
  font: 500 13px Raleway, sans-serif; cursor: pointer;
}
.pill[aria-pressed=true] { background: var(--ice); border-color: var(--action); color: var(--navy); }

/* Fülek */
.tabs { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; padding: 4px; border: 1px solid var(--mist); border-radius: 12px; background: var(--ice); }
.tabs button { min-height: 40px; border: 0; border-radius: 9px; background: none; color: var(--muted); font: 500 13px Raleway, sans-serif; cursor: pointer; }
.tabs button[aria-selected=true] { background: var(--mist); color: var(--navy); }

/* Vészfék sáv */
.brake-banner { background: var(--deep); color: var(--white); padding: 12px 20px; font-size: 14px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.brake-banner a { color: var(--white); font-weight: 600; }
.dryrun-banner { background: var(--ice); color: var(--navy); border-bottom: 1px solid var(--mist); padding: 8px 20px; font-size: 12px; text-align: center; }
.alert { border-left: 3px solid var(--action); }
.alert.error { border-left-color: var(--deep); }

/* Naptár */
.day { display: grid; grid-template-columns: 44px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--mist); align-items: start; }
.day .date { line-height: 1.2; }
.day .date { text-align: center; color: var(--muted); }
.day .date b { display: block; font-size: 20px; color: var(--navy); font-weight: 600; }
.day.today .date b { color: var(--action); }
.entry { display: flex; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--ice); border: 1px solid var(--mist); text-decoration: none; color: var(--ink); font-size: 13px; }
.entry + .entry { margin-top: 6px; }
.entry.pending { background: none; border-style: dashed; }

/* Alsó menü */
nav.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--nav-h) + var(--safe-bottom)); padding-bottom: var(--safe-bottom);
  background: var(--white); border-top: 1px solid var(--mist); display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); z-index: 10;
}
nav.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-decoration: none; color: var(--muted); font-size: 11px; }
nav.tabbar a[aria-current=page] { color: var(--action); }
.fab {
  position: fixed; right: 20px; bottom: calc(var(--nav-h) + var(--safe-bottom) + 16px); height: 52px; padding: 0 20px 0 16px; border-radius: 26px;
  background: var(--action); color: var(--white); display: flex; align-items: center; gap: 8px; text-decoration: none; font: 600 14px Raleway, sans-serif;
  box-shadow: 0 8px 24px rgba(2, 74, 110, 0.22); z-index: 11;
}
.fab:hover { color: var(--white); background: var(--navy); }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + var(--safe-bottom) + 84px); background: var(--deep); color: var(--white); padding: 10px 16px; border-radius: 10px; font-size: 14px; z-index: 20; max-width: 90vw; }

/* Bejelentkezés */
.auth { max-width: 380px; margin: 0 auto; padding: 64px 24px; display: flex; flex-direction: column; gap: 16px; }
.auth img { width: 180px; height: auto; align-self: center; margin-bottom: 8px; }
.error-text { color: var(--deep); font-weight: 600; font-size: 14px; min-height: 20px; }

table.log { width: 100%; border-collapse: collapse; font-size: 12px; }
table.log td { padding: 8px 4px; border-bottom: 1px solid var(--mist); vertical-align: top; }
table.log td:first-child { white-space: nowrap; color: var(--muted); }
code { font-size: 11px; color: var(--muted); word-break: break-all; }

/* Eredmények */
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.kpi { border: 1px solid var(--mist); border-radius: var(--radius); background: var(--ice); padding: 14px; display: flex; flex-direction: column; gap: 2px; }
.kpi .num { font-size: 26px; font-weight: 700; color: var(--navy); line-height: 1.1; }
.kpi .lbl { font-size: 12px; letter-spacing: 0.08em; color: var(--muted); }

/* Bélyegképek a Drive-ról */
.thumb-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.thumb > svg:not(.bubbles) { z-index: 2; }
.media-strip { display: flex; gap: 8px; overflow-x: auto; margin: 12px 0 6px; }
.media-tile { position: relative; flex-shrink: 0; width: 120px; height: 160px; border-radius: 12px; background: var(--deep); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.media-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.media-tile svg { position: relative; }
.lib-thumb { flex-shrink: 0; width: 48px; height: 64px; border-radius: 8px; background: var(--mist); overflow: hidden; display: block; }
.lib-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Kész klip */
.thumb-badge { position: absolute; left: 6px; right: 6px; bottom: 6px; z-index: 3; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; text-align: center; color: var(--white); background: rgba(2, 74, 110, .85); border-radius: 6px; padding: 3px 0; }
.clip-preview { display: block; width: 100%; max-width: 320px; aspect-ratio: 9 / 16; margin: 0 auto; border-radius: 12px; background: var(--deep); object-fit: cover; }

/* Videó pillanatai a médiatárban */
.moments { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 4px; }
.moment { display: flex; gap: 8px; align-items: baseline; text-align: left; font: inherit; font-size: 12px; color: var(--ink); background: var(--white); border: 1px solid var(--mist); border-radius: 8px; padding: 6px 8px; cursor: pointer; }
.moment b { color: var(--navy); white-space: nowrap; font-weight: 600; }
.moment span { margin-left: auto; color: var(--action); font-weight: 700; white-space: nowrap; }
.moment:hover, .moment:focus-visible { border-color: var(--action); outline: none; }
.moment:disabled { opacity: .5; }
