/* homepage fonts, stored locally in /fonts (Rajdhani + Roboto, SIL OFL 1.1) */
@font-face { font-family: Rajdhani; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/rajdhani-500.woff2) format('woff2'); }
@font-face { font-family: Rajdhani; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/rajdhani-600.woff2) format('woff2'); }
@font-face { font-family: Rajdhani; font-style: normal; font-weight: 700; font-display: swap; src: url(/fonts/rajdhani-700.woff2) format('woff2'); }
@font-face { font-family: Roboto; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/fonts/roboto-latin-variable.woff2) format('woff2'); }

:root {
  /* colors and fonts of the TTS homepage (tts-sc.com theme: header #00303c, lime #c1d61e, petrol #005a70, Rajdhani + Roboto) */
  --navy: #00303c; --navy-2: #162125; --petrol: #005a70; --accent: #c1d61e; --accent-dark: #a9bc12; --on-accent: #00303c;
  --bg: #f4f4f4; --card: #fff; --line: #dde2e4;
  --text: #162125; --muted: #5a666b; --ok: #00303c; --lasso: #f1f5f6;
  --head-font: Rajdhani, "Segoe UI", Arial, sans-serif;
  font-family: Roboto, "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  color: var(--text); background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--petrol); }
h1, h2, .brand-text b, .fa-big, .toolhead h1, .dno { font-family: var(--head-font); }
code { background: #e9edf2; padding: 1px 5px; border-radius: 4px; font-size: .9em; }
.muted { color: var(--muted); font-weight: normal; }
small { font-size: .82em; }

.top { background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 14px 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.logo { display: block; height: 36px; width: auto; }
.brand-text b { font-size: 1.25em; font-weight: 600; letter-spacing: .3px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text small { opacity: .75; }
#nav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
#nav a, #nav .link { color: #fff; text-transform: uppercase; text-decoration: none; font-family: var(--head-font); font-weight: 600; letter-spacing: .4px; }
#nav a:hover, #nav .link:hover { color: var(--accent); }
#nav .who { opacity: .85; font-size: .9em; }
#nav select { padding: 4px 6px; border-radius: 6px; border: 0; }
.link { background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; font: inherit; color: var(--navy); }
.proto { background: #fff4e5; color: #8a4b0f; text-align: center; font-size: .8em; padding: 3px 8px; border-bottom: 1px solid #f3d9b5; }

main { width: 100%; max-width: 920px; margin: 0 auto; padding: 18px 16px 40px; flex: 1; }
h1 { font-size: 1.5em; margin: .3em 0 .4em; }
h2 { font-size: 1.1em; margin: 1.4em 0 .6em; }
.card h2 { margin-top: 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin: 14px 0; }
.narrow { max-width: 520px; margin: 30px auto; }
.empty { background: var(--card); border: 1px dashed var(--line); border-radius: 10px; padding: 18px; text-align: center; color: var(--muted); }
.hint { color: var(--muted); font-size: .88em; }
.notice { background: #fff4e5; border: 1px solid #f3d9b5; color: #8a4b0f; border-radius: 8px; padding: 10px 12px; margin-top: 0; }
.empty.older { border-color: #f3d9b5; background: #fffaf3; color: var(--text); }
.foot { text-align: center; color: var(--muted); font-size: .8em; padding: 16px; }

/* search */
.search { display: flex; gap: 8px; margin: 6px 0 14px; }
.search input { flex: 1; min-width: 0; font: inherit; font-size: 1.05em; padding: 11px 12px; border: 1px solid #b9c4d0; border-radius: 8px; background: #fff; }
.search input:focus { outline: 2px solid var(--petrol); border-color: transparent; }
.search button, .user { font: inherit; cursor: pointer; }
.search button { background: var(--accent); color: var(--on-accent); border: 0; border-radius: 8px; padding: 0 18px; font-weight: 700;
  font-family: var(--head-font); font-size: 1.1em; text-transform: uppercase; letter-spacing: .4px; }
.search button:hover { background: var(--accent-dark); }
.search.big input { font-size: 1.2em; padding: 14px; }
.hero { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px 18px 8px; }
.hero h1 { margin-top: 0; }

/* lists */
.list { background: var(--card); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.row { display: flex; align-items: center; gap: 14px; padding: 11px 14px; border-top: 1px solid var(--line); text-decoration: none; color: inherit; }
.row:first-child { border-top: 0; }
.row:hover { background: #f7f9fc; }
.row .main { flex: 1; min-width: 0; }
.row .main small { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .fa { font-family: Consolas, monospace; font-weight: 700; color: var(--navy); font-size: 1.05em; }
.row .date { text-align: right; white-space: nowrap; font-size: .9em; }
.row .date small { display: block; color: var(--muted); }
.tag { display: inline-block; background: #e8eef5; color: var(--navy-2); border-radius: 20px; padding: 1px 9px; font-size: .8em; margin-right: 4px; }
.badge { background: var(--accent); color: var(--on-accent); font-weight: 600; border-radius: 20px; padding: 1px 9px; font-size: .8em; }

/* tool page */
.toolhead small { color: var(--muted); text-transform: uppercase; letter-spacing: .5px; font-size: .75em; }
.toolhead h1 { font-size: 2.3em; margin: 0; line-height: 1.1; }
.toolhead p { margin: .3em 0 .6em; }
.order.newest { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.order-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 10px; }
.fa-big { font-family: Consolas, monospace; font-size: 1.9em; font-weight: 800; color: var(--navy); letter-spacing: 1px; }
.order-meta { display: flex; gap: 12px; align-items: center; color: var(--muted); font-size: .9em; flex-wrap: wrap; }
.tline { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--line); }
.tmark { font-family: Consolas, monospace; font-weight: 700; background: #222; color: #e8e8e8; border-radius: 6px; padding: 8px 10px;
  white-space: pre; min-width: 9.5em; text-align: center; font-size: .95em; }
.reports { display: flex; flex-wrap: wrap; gap: 8px; flex: 1; }

.rep { display: flex; border: 1px solid #b9c4d0; border-radius: 8px; overflow: hidden; background: #fff; }
.rep.lasso { background: var(--lasso); border-style: dashed; }
.rep a { text-decoration: none; color: inherit; }
.rep .open { display: flex; align-items: center; gap: 10px; padding: 7px 12px; }
.rep .open:hover, .rep .dl:hover { background: #eaf0f7; }
.rep .t { font-weight: 800; font-size: 1.15em; color: var(--navy); }
.rep .k { display: flex; flex-direction: column; line-height: 1.2; font-size: .92em; }
.rep .k small { color: var(--muted); }
.rep .dl { display: flex; align-items: center; padding: 0 12px; border-left: 1px solid #d3dbe4; font-size: 1.2em; color: var(--navy); }

/* laser result */
.laser-head { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.laser-head small { color: var(--muted); display: block; }
.lasermark { font-family: Consolas, monospace; font-size: 2em; font-weight: 800; background: #222; color: #eee; padding: 6px 14px; border-radius: 8px; white-space: pre; }
.laser-tool a { font-family: Consolas, monospace; font-size: 1.6em; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px 16px; margin: 10px 0 14px; }
.facts dt { color: var(--muted); font-size: .8em; }
.facts dd { margin: 0; font-weight: 600; }

/* login */
.userlist { display: grid; gap: 10px; }
.user { text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.user:hover { border-color: var(--navy); background: #f7f9fc; }
.user span { color: var(--muted); font-size: .88em; }
.user b { word-break: break-all; }
.loginform { margin-top: 12px; }
.testbox { background: #fafbfd; border-style: dashed; }
.testbox h2 small { font-weight: normal; font-size: .75em; }

/* admin */
.tbl { width: 100%; border-collapse: collapse; font-size: .9em; }
.tbl th, .tbl td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { color: var(--muted); font-weight: 600; background: #f7f9fc; }
.scroll { max-height: 380px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.count { background: var(--accent); color: var(--on-accent); border-radius: 20px; padding: 0 9px; font-size: .8em; }

/* report viewer */
body.viewing main { max-width: 1100px; padding-top: 0; }
.viewer { margin: 0 -16px; }
.vbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: #fff; border-bottom: 1px solid var(--line); padding: 8px 16px; }
.vback { display: inline-flex; align-items: center; gap: 8px; background: var(--navy); color: #fff; text-decoration: none; white-space: nowrap;
  border-radius: 8px; padding: 5px 14px 5px 10px; line-height: 1.1; box-shadow: 0 1px 2px rgba(0,0,0,.15); }
.vback:hover { background: var(--petrol); color: #fff; }
.vback:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.varr { font-size: 1.9em; line-height: .8; margin-top: -3px; color: var(--accent); font-weight: 700; }
.vbtxt { display: flex; flex-direction: column; }
.vbtxt small { font-size: .72em; opacity: .8; text-transform: uppercase; letter-spacing: .5px; }
.vbtxt b { font-family: var(--head-font); font-size: 1.15em; letter-spacing: .3px; }
.vtitle { flex: 1; min-width: 120px; display: flex; flex-direction: column; line-height: 1.2; }
.vtitle b { font-family: Consolas, monospace; font-size: 1.1em; color: var(--navy); }
.vtitle small { color: var(--muted); }
.vtools { display: flex; gap: 6px; align-items: center; }
.vtools button, .vdl { font: inherit; border: 1px solid #b9c4d0; background: #fff; border-radius: 6px; padding: 5px 11px; cursor: pointer;
  color: var(--navy); text-decoration: none; min-width: 36px; text-align: center; }
.vtools button:hover, .vdl:hover { background: #eaf0f7; }
.vdl { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700; }
.vdl:hover { background: var(--accent-dark); }
.vsib { padding: 6px 16px; font-size: .9em; background: var(--lasso); border-bottom: 1px solid var(--line); }
.pages { padding: 12px 16px; display: flex; flex-direction: column; align-items: center; gap: 12px; overflow-x: auto; }
.pages.zoomed { align-items: flex-start; }
.pages .page { background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.18); max-width: none; }
.vload { padding: 40px; }
.psep { align-self: stretch; text-align: center; padding: 10px; margin-top: 8px; background: var(--lasso); border: 1px dashed #9db4cf;
  border-radius: 8px; color: var(--navy-2); scroll-margin-top: 70px; }
.psep small { color: var(--muted); }
.plus { display: inline-block; background: var(--lasso); color: var(--navy); border: 1px dashed #9db4cf; border-radius: 10px; padding: 0 6px; font-size: .82em; margin-left: 4px; }

@media (max-width: 600px) {
  .vdl span { display: none; }
  .pages { padding: 8px; }
  .tline { flex-direction: column; gap: 6px; }
  .tmark { min-width: 0; }
  .fa-big { font-size: 1.6em; }
  .row .date small { display: none; }
  .tbl { font-size: .8em; }
  .card .tbl { display: block; overflow-x: auto; }
}

/* customer drawing no. = main number */
.dno { font-size: 1.2em; color: var(--navy); letter-spacing: .3px; }
.row .main small { margin-top: 1px; }
.toolhead h1 { font-weight: 700; }
/* drawing buttons beside the report */
.rep.dwg { border-color: var(--petrol); }
.rep.dwg .k { color: var(--petrol); font-weight: 600; }
/* viewer: switch Report / Drawing / Customer drawing */
.vtabs { display: flex; gap: 4px; padding: 6px 16px 0; background: #fff; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.vtabs a, .vtabs b { padding: 6px 12px; border-radius: 6px 6px 0 0; text-decoration: none; font-family: var(--head-font); font-size: 1.05em; font-weight: 600; }
.vtabs b { background: var(--navy); color: #fff; }
.vtabs a { color: var(--petrol); }
.vtabs a:hover { background: #eef2f3; }
.proto { background: #f6f9dc; color: #4c5410; border-bottom-color: #e3eba0; }
.fa-line { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; }
.order-head { align-items: center; }

/* request access form */
.reqlink { margin: 12px 0 0; }
.form { display: grid; gap: 10px; margin-top: 10px; }
.form label { display: grid; gap: 4px; font-weight: 500; font-size: .95em; }
.form input, .form textarea { font: inherit; padding: 9px 10px; border: 1px solid #b9c4d0; border-radius: 8px; background: #fff; }
.form input:focus, .form textarea:focus { outline: 2px solid var(--petrol); border-color: transparent; }
.form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.btn { font: inherit; cursor: pointer; background: var(--accent); color: var(--on-accent); border: 0; border-radius: 8px; padding: 10px 18px;
  font-family: var(--head-font); font-weight: 700; font-size: 1.1em; text-transform: uppercase; letter-spacing: .4px; justify-self: start; }
.btn:hover { background: var(--accent-dark); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.small { padding: 5px 12px; font-size: 1em; }
a.btn { display: inline-block; text-decoration: none; }
/* All tools */
.alltools { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 4px 0 18px; }
.alltools .btn { font-size: 1em; padding: 8px 16px; }
.alltools small { flex: 1 1 220px; }
.listhead { font-size: 1em; text-transform: uppercase; letter-spacing: .5px; color: var(--muted, #5a666b); margin: 0 0 6px; }
.back { margin: 0 0 10px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.toolbar input { flex: 1 1 260px; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; min-width: 0; }
.toolbar select { font: inherit; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.toolbar input:focus, .toolbar select:focus { outline: 2px solid var(--petrol); border-color: transparent; }
.btn.big { display: block; text-align: center; padding: 14px 18px; font-size: 1.25em; margin: 18px 0 6px; }
.hint.staff { margin-top: 22px; padding-top: 10px; border-top: 1px solid #e3e8ea; text-align: right; font-size: .85em; }
.notice.warn { background: #fdeceb; border-color: #f2b8b5; color: #8c1d18; }
/* admin: access requests */
.req { border-top: 1px solid var(--line); padding: 12px 0; display: grid; gap: 6px; }
.req:first-of-type { border-top: 0; }
.req.decided > :not(.mailprev):not(.req-out) { opacity: .6; }
.req-who small { display: block; color: var(--muted); }
.req-msg { background: var(--lasso); border-radius: 6px; padding: 6px 10px; font-size: .92em; }
.req-flags { display: flex; gap: 6px; flex-wrap: wrap; }
.flag { border-radius: 20px; padding: 1px 9px; font-size: .8em; }
.flag.ok { background: #e7f3d0; color: #3c4a06; }
.flag.new { background: #e3eef1; color: var(--petrol); }
.flag.bad { background: #fde8e1; color: #8a2a0c; }
.req-act { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.req-act select { font: inherit; padding: 5px 8px; border-radius: 6px; border: 1px solid #b9c4d0; }
.req-dom { font-size: .88em; display: flex; gap: 6px; align-items: center; }
.req-done summary { cursor: pointer; color: var(--muted); margin-top: 8px; }

/* admin: preview of the e-mail to the person */
.mailprev { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.mailhead { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; padding: 8px 12px; background: #f7f9fa; font-size: .88em; border-bottom: 1px solid var(--line); }
.mailhead span { color: var(--muted); }
.mailprev iframe { width: 100%; height: 470px; border: 0; display: block; }

/* colleagues page (customer admin) */
.addrow { display: flex; gap: 8px; flex-wrap: wrap; }
.addrow input { flex: 1 1 200px; font: inherit; padding: 9px 10px; border: 1px solid #b9c4d0; border-radius: 8px; }
.addrow input:focus { outline: 2px solid var(--petrol); border-color: transparent; }
.people { display: grid; }
.person { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.person:first-child { border-top: 0; }
.pmain { flex: 1; min-width: 0; }
.pmain small { display: block; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.pmeta { text-align: right; font-size: .9em; white-space: nowrap; }
.pmeta small { display: block; color: var(--muted); font-size: .8em; }
.pact { min-width: 64px; text-align: right; }

/* help page */
.help { max-width: 760px; margin: 0 auto; }
.help h1 { font-size: 1.9em; margin-bottom: .2em; }
.help .lead { font-size: 1.1em; color: var(--muted); margin-top: 0; }
.hback { margin: 0 0 6px; font-size: .92em; }
.htoc { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0 6px; }
.htoc a { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 4px 12px; text-decoration: none; font-size: .9em; }
.htoc a:hover { border-color: var(--petrol); }
.hstep { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; margin: 14px 0; scroll-margin-top: 10px; }
.hstep h2 { margin: 0 0 10px; display: flex; align-items: center; gap: 10px; font-size: 1.35em; }
.hn { background: var(--accent); color: var(--on-accent); border-radius: 50%; width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.hstep ol, .hstep ul { margin: 0; padding-left: 20px; line-height: 1.6; }
.hrow { display: grid; grid-template-columns: 1fr 260px; gap: 18px; align-items: start; }
.hnote { color: var(--muted); font-size: .92em; margin: 12px 0 0; }
.hways { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.hways.two { grid-template-columns: repeat(2, 1fr); }
.hway { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.hway > span { color: var(--muted); font-size: .92em; }
.kbd { border: 1px solid #b9c4d0; border-radius: 4px; padding: 0 5px; font-size: .9em; background: #fafafa; }
.hfaq dt { font-weight: 600; margin-top: 10px; }
.hfaq dd { margin: 2px 0 0; color: var(--muted); }
.hcontact { margin: 16px 0 0; padding-top: 12px; border-top: 1px solid var(--line); }
/* drawn examples */
.mock { background: #f4f4f4; border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: grid; gap: 6px; font-size: .9em; margin-top: 6px; }
.m-field { background: #fff; border: 1px solid #b9c4d0; border-radius: 6px; padding: 7px 9px; color: #7b878c; }
.m-btn { background: var(--accent); color: var(--on-accent); font-family: var(--head-font); font-weight: 700; border-radius: 6px; padding: 6px; text-align: center; }
.m-code { background: #fff; border-radius: 6px; padding: 6px 9px; border: 1px dashed #b9c4d0; }
.m-code small { display: block; color: var(--muted); }
.m-code b { font-family: Consolas, monospace; font-size: 1.2em; letter-spacing: 1px; }
.m-laser { background: #222; color: #eee; font-family: Consolas, monospace; font-weight: 700; border-radius: 6px; padding: 7px; text-align: center; }
.m-cap { color: var(--muted); }
.m-qr { width: 78px; height: 78px; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 6px; background: #fff; }
.m-qr i { background: #00303c; border-radius: 2px; }
.m-qr i:nth-child(2), .m-qr i:nth-child(4), .m-qr i:nth-child(6), .m-qr i:nth-child(8) { background: #fff; outline: 3px solid #00303c; outline-offset: -6px; }
.m-order { background: #fff; border: 2px solid var(--accent); }
.m-ohead { display: flex; align-items: center; gap: 8px; }
.m-fa { font-family: Consolas, monospace; font-weight: 800; color: var(--navy); font-size: 1.15em; }
.m-dwg { border: 1px solid var(--petrol); color: var(--petrol); border-radius: 6px; padding: 1px 7px; font-weight: 600; display: flex; flex-direction: column; line-height: 1.1; }
.m-dwg small { color: var(--muted); font-weight: normal; font-size: .78em; }
.m-tline { display: flex; gap: 6px; align-items: center; border-top: 1px solid var(--line); padding-top: 6px; }
.m-mark { background: #222; color: #eee; font-family: Consolas, monospace; font-size: .8em; border-radius: 4px; padding: 3px 5px; white-space: nowrap; }
.m-rep { border: 1px solid #b9c4d0; border-radius: 6px; padding: 2px 6px; white-space: nowrap; }
.m-rep b { color: var(--navy); }
.m-rep i { font-style: normal; color: var(--navy); margin-left: 4px; }
@media (max-width: 640px) {
  .hrow, .hways, .hways.two { grid-template-columns: 1fr; }
  .help h1 { font-size: 1.5em; }
}

/* order box: drawing and report buttons in one column, same size (Frank) */
.order { --markw: 10.5rem; }
.order-head { margin-bottom: 4px; }
.fa-line { display: grid; grid-template-columns: var(--markw) auto; gap: 12px; align-items: center; }
.fa-line .fa-big { font-size: 1.75em; letter-spacing: .5px; }
.tline { align-items: center; }
.tmark { width: var(--markw); min-width: 0; box-sizing: border-box; }
.rep { width: 15.5rem; min-height: 50px; }
.rep .open { flex: 1; min-width: 0; }
.rep .t { min-width: 2.4em; text-align: center; display: inline-flex; justify-content: center; }
.rep .dl { width: 44px; justify-content: center; padding: 0; }
.rep.dwg .t { color: var(--petrol); }
.rep .k small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 600px) {
  .order { --markw: auto; }
  .fa-line { grid-template-columns: 1fr; }
  .rep { width: 100%; }
  .tmark { width: auto; }
}
@media (max-width: 600px) { .tline { align-items: stretch; } .tmark { text-align: left; } }

/* order box: buttons left, order info in a column on the right (Frank: use the empty space) */
.order { display: grid; grid-template-columns: minmax(0, 1fr) 13rem; gap: 0 22px; }
.order-main { min-width: 0; }
.order-info { margin: 0; padding-left: 18px; border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; align-self: stretch; }
.order-info dt { color: var(--muted); font-size: .78em; text-transform: uppercase; letter-spacing: .4px; }
.order-info dd { margin: 1px 0 0; font-weight: 600; color: var(--navy-2); }
.oi-badge .badge { font-size: .85em; padding: 2px 10px; }
@media (max-width: 760px) {
  .order { grid-template-columns: 1fr; }
  .order-info { border-left: 0; padding-left: 0; flex-direction: row; flex-wrap: wrap; gap: 6px 18px; order: -1; padding-bottom: 8px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
  .order-info dd { font-weight: 500; }
}

/* Drawing and Report buttons look the same (Frank): same border, font and colors */
.rep, .rep.dwg { border-color: #b9c4d0; }
.rep .k, .rep.dwg .k { color: var(--text); font-weight: 500; }
.rep .t, .rep.dwg .t { color: var(--navy); }
.rep .k small { font-weight: 400; }


/* order info: all reports of the order as one PDF (no drawing) */
.oi-dl { margin-top: auto; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; background: var(--accent); color: var(--on-accent);
  border-radius: 8px; padding: 8px 12px; text-decoration: none; font-family: var(--head-font); font-weight: 700; font-size: 1.05em; letter-spacing: .3px; }
.oi-dl small { font-family: Roboto, sans-serif; font-weight: 400; font-size: .72em; letter-spacing: 0; opacity: .85; }
.oi-dl:hover { background: var(--accent-dark); }
@media (max-width: 760px) { .oi-dl { margin-top: 0; flex-direction: row; align-items: center; gap: 8px; padding: 5px 10px; } }

/* clear division between drawing (order head) and reports (Frank) */
.order-head { border-bottom: 2px solid #8fa3ae; padding-bottom: 10px; margin-bottom: 2px; }
.order-head + .tline { border-top: 0; }

/* tools with many reports (Frank): folded older orders, compact tiles, quick filter */
.order-inner { display: contents; }
details.order { display: block; padding: 0; }
details.order > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 14px; padding: 12px 16px; flex-wrap: wrap; }
details.order > summary::-webkit-details-marker { display: none; }
details.order > summary:hover { background: #f7f9fa; }
details.order[open] > summary { border-bottom: 1px solid var(--line); }
details.order > .order-inner { display: grid; grid-template-columns: minmax(0, 1fr) 13rem; gap: 0 22px; padding: 14px 16px 16px; }
.fa-sum { font-family: Consolas, monospace; font-weight: 800; font-size: 1.25em; color: var(--navy); letter-spacing: .5px; }
.sum-meta { color: var(--muted); flex: 1; }
.sum-open { color: var(--petrol); font-weight: 600; }
.sum-open::after { content: ' ▸'; }
details.order[open] .sum-open { font-size: 0; }
details.order[open] .sum-open::after { content: '▾ Hide'; font-size: 1rem; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.6rem, 1fr)); gap: 8px; padding-top: 10px; }
.tile { display: flex; border: 1px solid #b9c4d0; border-radius: 8px; overflow: hidden; background: #fff; }
.tile a { text-decoration: none; color: inherit; }
.tile .open { flex: 1; min-width: 0; padding: 6px 8px; display: flex; flex-direction: column; line-height: 1.15; }
.tile .open b { color: var(--navy); font-size: 1.05em; }
.tile .open small { color: var(--muted); font-family: Consolas, monospace; font-size: .72em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .dl { display: flex; align-items: center; justify-content: center; width: 34px; border-left: 1px solid #d3dbe4; color: var(--navy); }
.tile .open:hover, .tile .dl:hover { background: #eaf0f7; }
.tfilter { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 4px 0 12px; }
.tfilter input { flex: 1 1 260px; font: inherit; padding: 9px 11px; border: 1px solid #b9c4d0; border-radius: 8px; background: #fff; }
.tfilter input:focus { outline: 2px solid var(--petrol); border-color: transparent; }
@media (max-width: 760px) { details.order > .order-inner { grid-template-columns: 1fr; } .tiles { grid-template-columns: repeat(auto-fill, minmax(7.4rem, 1fr)); } }
.m-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; border-top: 2px solid #8fa3ae; padding-top: 6px; }
.m-tile { border: 1px solid #b9c4d0; border-radius: 6px; padding: 3px 6px; display: grid; grid-template-columns: 1fr auto; line-height: 1.1; }
.m-tile b { color: var(--navy); }
.m-tile small { grid-column: 1; color: var(--muted); font-family: Consolas, monospace; font-size: .7em; }
.m-tile i { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-style: normal; color: var(--navy); }

/* admin: invite + login actions */
.inv .addrow select { font: inherit; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.chk { display: flex; gap: 8px; align-items: flex-start; font-size: .95em; margin: 6px 0; }
.chk input { margin-top: 4px; }
.uact { white-space: nowrap; }
.uact .link { margin-right: 10px; }
.pact .link + .link { margin-left: 10px; }
.form label.chk { display: flex; gap: 8px; align-items: flex-start; font-weight: normal; }
.form label.chk input { width: 18px; height: 18px; padding: 0; margin: 2px 0 0; flex: none; }
.inv { display: grid; gap: 8px; }
.inv .addrow input { flex: 1 1 180px; }
.link.danger { color: #b3261e; }
/* e-mail as name part + fixed domain */
.emailbox { display: flex; align-items: center; gap: 4px; flex: 2 1 320px; min-width: 0; }
.emailbox input[name=local] { flex: 1 1 120px; min-width: 0; }
.emailbox .at { font-weight: 700; color: var(--petrol); }
.emailbox select, .emailbox input[name=newdomain] { flex: 1 1 140px; min-width: 0; font: inherit; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: #f4f7f8; }
.addrow .emailbox input { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
.invcust { font: inherit; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; max-width: 320px; }
.notice.ok { background: #eef6e4; border-color: #c9dfa8; color: #3d5a12; }

/* link back to the TTS homepage under the login box */
.backsite { text-align: center; margin: 18px 0 0; font-size: 15px; }
.backsite a { color: #005a70; text-decoration: none; font-weight: 600; }
.backsite a:hover { text-decoration: underline; }
.foot .stafflink { color: var(--muted); text-decoration: none; }
.foot .stafflink:hover { text-decoration: underline; }
/* "Install the portal as an app" box on the start page */
.install { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid #dfe6e8; border-left: 4px solid #c1d61e; border-radius: 8px; padding: 10px 14px; margin: 0 0 16px; font-size: .92em; }
.install img { width: 36px; height: 36px; border-radius: 8px; flex: none; }
.install span { flex: 1; }
.install .btn { flex: none; }
.foot .sitelink { color: var(--muted); text-decoration: none; }
.foot .sitelink:hover { text-decoration: underline; color: #005a70; }
/* e-mail domain shown as plain text when there is only one (no choice) */
.emailbox select.single { appearance: none; -webkit-appearance: none; border-color: transparent; background: transparent; pointer-events: none; padding-left: 2px; color: var(--ink, #162125); }
/* "+ Add a new customer" box and the Edit row of a customer */
.addcust { border: 1px solid #dfe6e8; border-left: 4px solid #c1d61e; border-radius: 8px; padding: 10px 14px; margin: 10px 0; background: #fafcfc; }
.addcust h3 { margin: 0 0 8px; font-size: 1.05em; }
.addcust label { display: block; margin: 8px 0; font-weight: 600; }
.addcust label small { font-weight: 400; }
.addcust input, .addcust select { display: block; width: 100%; max-width: 420px; margin-top: 4px; font-weight: 400; }
