/* SGWS Safety Talks 2027, program office. Industrial and quiet: warm paper, ink, one red. */
:root {
  --sg: #9b1b1f; --sg-deep: #7a1417; --sg-tint: #f6e9e8; --sg-glow: rgba(155, 27, 31, .18);
  --paper: #f4f1ec; --card: #fffdfa; --ink: #18191a; --ink2: #3d4043; --ink3: #74797e; --rule: #e2ddd5; --rule2: #d3ccc2;
  --ok: #1e6e47; --ok-tint: #e6f2ea; --amber: #a3620f; --amber-tint: #faf0de;
  --d: "Archivo", "Helvetica Neue", sans-serif; --b: "Instrument Sans", "Helvetica Neue", sans-serif;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --lift: 0 1px 1px rgba(60, 30, 20, .05), 0 2px 6px -2px rgba(60, 30, 20, .08);
  --float: 0 2px 4px rgba(60, 30, 20, .06), 0 22px 44px -16px rgba(60, 30, 20, .28);
  --spring: cubic-bezier(.2, .9, .25, 1.1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink2); font: 15px/1.55 var(--b); -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .5;
  background: radial-gradient(1200px 500px at 85% -10%, rgba(155, 27, 31, .07), transparent 60%), radial-gradient(900px 400px at -10% 110%, rgba(120, 90, 60, .07), transparent 60%); }
a { color: var(--sg); }
h1, h2, h3 { font-family: var(--d); color: var(--ink); margin: 0; }
:focus-visible { outline: 3px solid var(--sg); outline-offset: 2px; border-radius: 4px; }

/* top bar */
.top { position: sticky; top: 0; z-index: 20; background: rgba(244, 241, 236, .88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--rule); }
.top .in { max-width: 1440px; margin: 0 auto; padding: 0 var(--s5); height: 56px; display: flex; align-items: center; gap: var(--s5); }
.brand { display: flex; align-items: center; gap: var(--s3); text-decoration: none; color: var(--ink); font: 700 15px var(--d); font-stretch: 85%; letter-spacing: .01em; text-transform: uppercase; }
.brand i { width: 26px; height: 26px; border-radius: 5px; background: var(--sg); display: grid; place-items: center; color: #fff; font: 800 13px var(--d); font-style: normal; }
.nav { display: flex; gap: var(--s1); }
.nav a { text-decoration: none; color: var(--ink2); font-weight: 500; padding: 7px 12px; border-radius: 6px; transition: background-color .15s, color .15s; }
.nav a:hover { background: rgba(0, 0, 0, .05); }
.nav a.on { color: var(--ink); background: var(--card); box-shadow: var(--lift); }
.who { margin-left: auto; display: flex; align-items: center; gap: var(--s3); font-size: 13px; color: var(--ink3); }
.who a { color: var(--ink3); }
.demo-pill { background: var(--amber-tint); color: var(--amber); font-weight: 600; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; padding: 3px 8px; border-radius: 4px; }

main.wrap { position: relative; z-index: 1; max-width: 1440px; margin: 0 auto; padding: var(--s6) var(--s5) var(--s7); }

/* buttons */
.btn { font: 600 14px var(--b); border: 1px solid var(--rule2); background: var(--card); color: var(--ink); border-radius: 6px; padding: 9px 14px; min-height: 40px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
  transition: transform .15s var(--spring), background-color .15s, border-color .15s, opacity .15s; }
.btn:hover { border-color: var(--ink3); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--sg); border-color: var(--sg); color: #fff; box-shadow: 0 1px 1px rgba(122, 20, 23, .2), 0 6px 14px -6px rgba(122, 20, 23, .5); }
.btn.primary:hover { background: var(--sg-deep); }
.btn.quiet { border-color: transparent; background: transparent; color: var(--ink2); }
.btn.quiet:hover { background: rgba(0, 0, 0, .05); }
.btn[disabled] { opacity: .5; cursor: default; }
.seg { display: inline-flex; background: rgba(0, 0, 0, .05); border-radius: 7px; padding: 3px; gap: 2px; }
.seg a, .seg button { font: 600 13px var(--b); padding: 6px 12px; border-radius: 5px; color: var(--ink2); text-decoration: none; border: 0; background: none; cursor: pointer; min-height: 32px; display: inline-flex; align-items: center; transition: background-color .15s, color .15s; }
.seg a:hover, .seg button:hover { color: var(--ink); }
.seg .on { background: var(--card); color: var(--ink); box-shadow: var(--lift); }
.seg .off { opacity: .45; }

/* ---------- calendar ---------- */
.yearhead { display: grid; grid-template-columns: auto 1fr auto; gap: var(--s6); align-items: end; margin-bottom: var(--s6); }
.year { font: 800 128px/.8 var(--d); font-stretch: 75%; letter-spacing: -.03em; color: var(--ink); }
.year span { color: var(--sg); }
.yearhead h1 { font-size: 28px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.yearhead p { margin: 6px 0 0; color: var(--ink3); max-width: 520px; }
.stats { display: flex; gap: var(--s5); }
.stat b { display: block; font: 700 34px/1 var(--d); font-stretch: 80%; color: var(--ink); letter-spacing: -.02em; }
.stat small { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink3); }
.toolbar { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; margin-bottom: var(--s5); padding: var(--s3); background: var(--card); border: 1px solid var(--rule); border-radius: 6px; box-shadow: var(--lift); }
.toolbar .hint { color: var(--ink3); font-size: 13px; margin-left: auto; }
.toolbar input[type=search] { font: inherit; border: 1px solid var(--rule2); border-radius: 6px; padding: 8px 12px; min-height: 40px; min-width: 220px; background: #fff; }
.month { display: grid; grid-template-columns: 132px 1fr; gap: var(--s5); padding: var(--s5) 0; border-top: 1px solid var(--rule); }
.month h2 { font: 700 13px var(--d); letter-spacing: .14em; text-transform: uppercase; color: var(--ink3); position: sticky; top: 76px; align-self: start; }
.month h2 b { display: block; font: 800 44px/1 var(--d); font-stretch: 75%; letter-spacing: -.02em; color: var(--ink); margin-bottom: 2px; }
.weeks { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s4); }
.tile { position: relative; background: var(--card); border: 1px solid var(--rule); border-radius: 6px; box-shadow: var(--lift); overflow: hidden; cursor: grab; display: flex; flex-direction: column;
  transition: transform .25s var(--spring), box-shadow .2s, border-color .2s, opacity .2s; text-decoration: none; color: inherit; }
.tile:hover { transform: translateY(-2px); box-shadow: var(--float); }
.tile:active { cursor: grabbing; }
.tile.dragging { opacity: .35; transform: scale(.97); }
.tile.target { border-color: var(--sg); box-shadow: 0 0 0 3px var(--sg-glow), var(--float); transform: translateY(-2px); }
.tile.dim { opacity: .28; }
.tile .pic { aspect-ratio: 5 / 4; background: repeating-linear-gradient(-45deg, #efebe5 0 10px, #f6f3ee 10px 20px); position: relative; }
.tile .pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile .pic:has(img)::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0, 0, 0, .55), transparent 55%); }
.tile .pic:not(:has(img)) .wk { color: var(--ink); text-shadow: none; }
.tile .pic:not(:has(img)) .dates { color: var(--ink3); }
.tile .wk { position: absolute; left: 10px; bottom: 6px; z-index: 1; font: 800 42px/1 var(--d); font-stretch: 75%; color: #fff; letter-spacing: -.02em; text-shadow: 0 1px 8px rgba(0, 0, 0, .3); }
.tile .dates { position: absolute; right: 10px; bottom: 10px; z-index: 1; color: rgba(255, 255, 255, .92); font-size: 11.5px; font-weight: 600; letter-spacing: .02em; }
.tile .noimg { position: absolute; top: 10px; left: 10px; z-index: 1; font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink3); }
.tile .body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.tile h3 { font: 650 15px/1.25 var(--d); letter-spacing: -.005em; }
.tile .meta { display: flex; align-items: center; gap: 6px; margin-top: auto; }
.chip { font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; padding: 3px 7px; border-radius: 4px; background: rgba(0, 0, 0, .05); color: var(--ink3); }
.chip.review { background: var(--amber-tint); color: var(--amber); }
.chip.approved { background: var(--ok-tint); color: var(--ok); }
.langs { margin-left: auto; display: flex; gap: 3px; }
.langs span { font-size: 10px; font-weight: 700; padding: 2px 4px; border-radius: 3px; border: 1px solid var(--rule2); color: var(--ink3); }
.langs span.has { background: var(--ink); border-color: var(--ink); color: #fff; }
.tile .moved { position: absolute; top: 10px; right: 10px; z-index: 1; background: var(--sg); color: #fff; font-size: 10.5px; font-weight: 700; padding: 3px 7px; border-radius: 4px; letter-spacing: .04em; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; z-index: 50; background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 6px; box-shadow: var(--float); display: flex; gap: var(--s4); align-items: center; font-size: 14px; transition: transform .3s var(--spring), opacity .2s; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast button { background: none; border: 0; color: #f3b9b9; font: 600 14px var(--b); cursor: pointer; padding: 4px; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.month { animation: rise .5s var(--spring) both; }

/* ---------- editor ---------- */
.edit { display: grid; grid-template-columns: minmax(380px, 520px) 1fr; gap: var(--s5); align-items: start; }
.edhead { display: flex; align-items: center; gap: var(--s4); flex-wrap: wrap; margin-bottom: var(--s5); }
.edhead .wkbig { font: 800 64px/.85 var(--d); font-stretch: 75%; color: var(--sg); letter-spacing: -.02em; }
.edhead h1 { font-size: 26px; letter-spacing: -.02em; line-height: 1.1; }
.edhead p { margin: 2px 0 0; color: var(--ink3); font-size: 13px; }
.edhead .acts { margin-left: auto; display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; }
.panel { background: var(--card); border: 1px solid var(--rule); border-radius: 6px; box-shadow: var(--lift); }
.form { padding: var(--s4); max-height: calc(100vh - 210px); overflow: auto; }
.grp { padding: var(--s4) 0; border-bottom: 1px solid var(--rule); }
.grp:first-child { padding-top: 0; }
.grp > h2 { font: 700 12px var(--d); letter-spacing: .14em; text-transform: uppercase; color: var(--ink3); margin-bottom: var(--s3); }
.fld { display: block; margin-bottom: var(--s3); }
.fld > span { display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.fld > span em { font-style: normal; font-weight: 500; color: var(--ink3); }
.fld > span em.over { color: var(--sg); font-weight: 700; }
.fld textarea, .fld input, .fld select { width: 100%; font: 14px/1.5 var(--b); color: var(--ink); border: 1px solid var(--rule2); border-radius: 6px; padding: 8px 10px; background: #fff; resize: vertical; transition: border-color .15s, box-shadow .15s; }
.fld textarea:focus, .fld input:focus, .fld select:focus { outline: none; border-color: var(--sg); box-shadow: 0 0 0 3px var(--sg-glow); }
.sub2 { padding: var(--s3); border: 1px solid var(--rule); border-radius: 6px; margin-bottom: var(--s3); background: #fbf9f6; }
.sub2 > b { display: block; font: 700 12px var(--d); letter-spacing: .08em; text-transform: uppercase; color: var(--ink3); margin-bottom: var(--s2); }
.opts { display: grid; gap: 6px; }
.opt { display: grid; grid-template-columns: 22px 1fr; gap: 6px; align-items: center; }
.opt input[type=radio] { accent-color: var(--ok); width: 18px; height: 18px; }
.opt input[type=radio]:disabled { opacity: .6; }
.slots { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.slot { border: 1.5px dashed var(--rule2); border-radius: 6px; aspect-ratio: 4 / 5; position: relative; overflow: hidden; display: grid; place-items: center; text-align: center; cursor: pointer; background: #fbf9f6; transition: border-color .15s, background-color .15s; }
.slot:hover, .slot.over { border-color: var(--sg); background: var(--sg-tint); }
.slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slot .lbl { position: relative; z-index: 1; font-size: 12.5px; color: var(--ink3); padding: var(--s3); }
.slot .lbl b { display: block; color: var(--ink); font: 700 13px var(--d); margin-bottom: 2px; }
.slot.has .lbl { position: absolute; left: 6px; right: 6px; bottom: 6px; background: rgba(24, 25, 26, .78); color: #fff; border-radius: 4px; padding: 6px 8px; font-size: 12px; text-align: left; }
.slot.has .lbl b { color: #fff; }
.slot .x { position: absolute; top: 6px; right: 6px; z-index: 2; }
.slot input { display: none; }
.prompt { font-size: 12.5px; color: var(--ink3); background: #fbf9f6; border: 1px solid var(--rule); border-radius: 6px; padding: 8px 10px; margin-top: var(--s2); }
.preview { position: sticky; top: 72px; padding: var(--s3); }
.preview .bar { display: flex; gap: var(--s2); align-items: center; margin-bottom: var(--s3); flex-wrap: wrap; }
.preview .bar .fitwarn { color: var(--sg); font-size: 13px; font-weight: 600; }
.stage { background: #e6e2dc; border-radius: 6px; height: calc(100vh - 200px); overflow: auto; padding: var(--s4); }
.stage iframe { border: 0; display: block; margin: 0 auto; transform-origin: top center; background: transparent; }
.savebar { position: sticky; bottom: 0; background: var(--card); border-top: 1px solid var(--rule); padding: var(--s3) var(--s4); display: flex; gap: var(--s2); align-items: center; }
.savebar .state { font-size: 13px; color: var(--ink3); margin-right: auto; }
.savebar .state.dirty { color: var(--amber); font-weight: 600; }
.savebar .state.err { color: var(--sg); font-weight: 600; }
.versions { font-size: 13px; }
.versions li { margin-bottom: 4px; }

/* ---------- results ---------- */
table.data { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--rule); border-radius: 6px; overflow: hidden; box-shadow: var(--lift); font-size: 14px; }
table.data th { text-align: left; font: 700 11px var(--d); letter-spacing: .12em; text-transform: uppercase; color: var(--ink3); padding: 10px 12px; background: #f9f6f1; border-bottom: 1px solid var(--rule); }
table.data td { padding: 10px 12px; border-bottom: 1px solid var(--rule); }
table.data td.n { font-variant-numeric: tabular-nums; text-align: right; }
.bars { display: flex; gap: 3px; align-items: flex-end; height: 22px; }
.bars i { width: 8px; background: var(--sg); border-radius: 2px 2px 0 0; opacity: .85; }
.cols2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: var(--s5); align-items: start; }
.section-h { display: flex; align-items: baseline; justify-content: space-between; margin: 0 0 var(--s3); }
.section-h h2 { font-size: 20px; letter-spacing: -.01em; }
.empty-state { padding: var(--s6); text-align: center; color: var(--ink3); background: var(--card); border: 1px dashed var(--rule2); border-radius: 6px; }

/* ---------- print toolbar ---------- */
.printbar { position: sticky; top: 0; z-index: 5; display: flex; gap: var(--s3); align-items: center; justify-content: center; flex-wrap: wrap; padding: 10px 16px; margin: -24px 0 24px; background: rgba(244, 241, 236, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--rule); font: 14px var(--b); }
.printbar .back { text-decoration: none; color: var(--ink2); font-weight: 600; padding: 6px 10px; border-radius: 6px; }
.printbar .back:hover { background: rgba(0, 0, 0, .05); }
.printnote { text-align: center; color: var(--amber); font: 600 14px var(--b); }

/* ---------- login ---------- */
body.login { display: grid; place-items: center; min-height: 100vh; padding: var(--s4); }
.loginbox { position: relative; z-index: 1; width: 100%; max-width: 400px; }
.loginbox .mark { font: 800 96px/.8 var(--d); font-stretch: 75%; color: var(--ink); letter-spacing: -.03em; }
.loginbox .mark span { color: var(--sg); }
.loginbox h1 { font-size: 22px; margin: 12px 0 4px; }
.loginbox p { color: var(--ink3); margin: 0 0 var(--s5); }
.loginbox form { background: var(--card); border: 1px solid var(--rule); border-radius: 6px; padding: var(--s5); box-shadow: var(--float); }
.loginbox .btn { width: 100%; justify-content: center; min-height: 46px; }
.err-msg { color: var(--sg); font-weight: 600; font-size: 14px; margin: 0 0 var(--s3); }

@media (max-width: 1180px) { .weeks { grid-template-columns: repeat(3, minmax(0, 1fr)); } .edit { grid-template-columns: 1fr; } .preview { position: static; } .form { max-height: none; } .cols2 { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .top .in { padding: 0 var(--s4); gap: var(--s3); } .brand span { display: none; }
  main.wrap { padding: var(--s5) var(--s4) var(--s7); }
  .yearhead { grid-template-columns: 1fr; gap: var(--s3); } .year { font-size: 88px; }
  .month { grid-template-columns: 1fr; gap: var(--s3); } .month h2 { position: static; } .month h2 b { display: inline; font-size: 28px; margin-right: 8px; }
  .weeks { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
  .toolbar .hint { display: none; } .toolbar input[type=search] { min-width: 0; flex: 1; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- tray: talks off the calendar ---------- */
.tray { border: 1.5px dashed var(--rule2); border-radius: 6px; padding: var(--s3) var(--s4); margin-bottom: var(--s5); background: rgba(255, 253, 250, .6); transition: border-color .15s, background-color .15s; }
.is-dragging .tray { border-color: var(--ink3); }
.tray.target { border-color: var(--sg); background: var(--sg-tint); }
.trayhead { display: flex; gap: var(--s3); align-items: baseline; flex-wrap: wrap; }
.trayhead h2 { font: 700 12px var(--d); letter-spacing: .14em; text-transform: uppercase; color: var(--ink); }
.trayhead span { font-size: 13px; color: var(--ink3); }
.traylist { display: flex; flex-wrap: wrap; gap: var(--s2); }
.traylist:not(:empty) { margin-top: var(--s3); }
.chiptalk { display: flex; align-items: center; gap: var(--s2); padding: 6px 10px 6px 6px; background: var(--card); border: 1px solid var(--rule); border-radius: 6px; box-shadow: var(--lift); text-decoration: none; color: var(--ink); cursor: grab; font-size: 13.5px; transition: transform .2s var(--spring), box-shadow .2s; }
.chiptalk:hover { transform: translateY(-1px); box-shadow: var(--float); }
.thumb { width: 34px; height: 34px; border-radius: 4px; overflow: hidden; flex: none; background: repeating-linear-gradient(-45deg, #efebe5 0 6px, #f6f3ee 6px 12px); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chiptalk.dragging, .bar.dragging { opacity: .35; }
.chiptalk.dim, .bar.dim { opacity: .28; }

/* open week in the year view */
.tile.open { cursor: default; border-style: dashed; box-shadow: none; background: transparent; }
.tile.open:hover { transform: none; box-shadow: none; }
.tile.open .pic { background: transparent; }
.tile.open h3 { color: var(--ink3); }
.hint2 { margin: 0; font-size: 12.5px; color: var(--ink3); }

/* ---------- month view ---------- */
.mhead { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s4); }
.mhead h2 { font: 800 40px/1 var(--d); font-stretch: 78%; letter-spacing: -.02em; min-width: 260px; text-align: center; }
.mhead .btn { font-size: 18px; min-width: 44px; justify-content: center; }
.mpills { margin-left: auto; display: flex; gap: 2px; flex-wrap: wrap; background: rgba(0, 0, 0, .05); border-radius: 7px; padding: 3px; }
.mpills button { font: 600 12.5px var(--b); border: 0; background: none; padding: 6px 9px; border-radius: 5px; cursor: pointer; color: var(--ink2); min-height: 30px; }
.mpills button.on { background: var(--card); color: var(--ink); box-shadow: var(--lift); }
.mgrid { background: var(--card); border: 1px solid var(--rule); border-radius: 6px; box-shadow: var(--lift); overflow: hidden; }
.dows, .mrow { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.dows span { padding: 10px 12px; font: 700 11px var(--d); letter-spacing: .14em; text-transform: uppercase; color: var(--ink3); background: #f9f6f1; border-bottom: 1px solid var(--rule); }
.mrow { position: relative; min-height: 132px; border-bottom: 1px solid var(--rule); transition: background-color .15s; }
.mrow:last-child { border-bottom: 0; }
.mrow.target { background: var(--sg-tint); }
.day { border-right: 1px solid var(--rule); padding: 8px 10px; }
.day:last-of-type { border-right: 0; }
.day span { font: 600 13px var(--d); color: var(--ink2); font-variant-numeric: tabular-nums; }
.day.out span { color: #bdb6ad; }
.bar { position: absolute; left: 8px; right: 8px; bottom: 10px; display: flex; align-items: center; gap: var(--s3); padding: 8px 12px 8px 8px; border-radius: 6px; background: var(--card); border: 1px solid var(--rule2); box-shadow: var(--float); text-decoration: none; color: var(--ink); cursor: grab; transition: transform .2s var(--spring), box-shadow .2s; }
.bar:hover { transform: translateY(-1px); }
.bar .thumb { width: 48px; height: 48px; }
.bar .bwk { font: 800 22px/1 var(--d); font-stretch: 75%; color: var(--sg); white-space: nowrap; }
.bar b { font: 650 16px/1.2 var(--d); flex: 1; min-width: 0; }
.bar .langs { margin-left: 0; }
.bar.empty { justify-content: center; border-style: dashed; box-shadow: none; background: transparent; color: var(--ink3); cursor: default; font-size: 13.5px; min-height: 66px; }
.mrow.target .bar.empty { border-color: var(--sg); color: var(--sg); }
@media (max-width: 760px) {
  .mhead h2 { min-width: 0; font-size: 30px; } .mpills { margin-left: 0; }
  .mrow { min-height: 150px; } .day { padding: 6px; } .bar { flex-wrap: wrap; } .bar .chip, .bar .langs { display: none; }
}
