:root {
  font-family: 'Segoe UI', system-ui, sans-serif;
  color: #103e3a;
  background: #f1f6f5;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
main { padding-inline: 20px; }
.grid > *, .row > *, .welcome > *, .account-bar > *, .material-row > * { min-width: 0; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 12px; }
input, select, textarea, fieldset { min-width: 0; max-width: 100%; }
input[type=date], input[type=datetime-local] { width: 100%; min-inline-size: 0; }
input[type=date], input[type=datetime-local] { display: block; max-inline-size: 100%; -webkit-appearance: none; appearance: none; }
input::-webkit-date-and-time-value { min-width: 0; text-align: left; }
input::-webkit-datetime-edit { min-width: 0; padding: 0; }
.notice, .report-lines, .bundle-row, .account-bar, .welcome, #bundleTitle { overflow-wrap: anywhere; }
.entries-container { max-width: 100%; overflow-x: auto; }
.entries-table { table-layout: fixed; }
.entries-table th:first-child { width: 21%; }
.entries-table th:nth-child(2) { width: 37%; }
.entries-table th:nth-child(3) { width: 10%; }
.entries-table th:nth-child(4) { width: 10%; }
.entries-table th:nth-child(5) { width: 22%; }
.entries-table td { overflow-wrap: anywhere; }
dialog { max-width: min(740px, calc(100vw - 24px)); max-height: 90vh; max-height: 90dvh; overflow-y: auto; overscroll-behavior: contain; }
.bundle-row details { flex-basis: 100%; min-width: 0; }
.entry-choice { min-height: 44px; }
[hidden] { display: none !important; }
.login-page { min-height: 100vh; }
.login-shell { width: min(100%, 640px); padding: 30px 20px; margin: 0 auto; }
.login-logo { width: 100%; height: auto; margin: 20px 0; }
.login-shell .card { padding: 32px; background: white; }
.login-shell h1 { font-size: 30px; margin: 14px 0; }
.login-shell input, #passwordDialog input { width: 100%; padding: 12px; font: inherit; border: 1px solid #c7dad2; border-radius: 8px; }
.login-shell label, #passwordDialog label { display: block; margin: 16px 0 6px; }
.login-shell button { width: 100%; margin-top: 24px; }
.login-shell fieldset { border: 1px solid #d1e3da; border-radius: 10px; padding: 18px; margin: 20px 0; }
.login-shell legend { color: #087b64; font-weight: 650; }
.account-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-bottom: 20px; color: #45695e; font-size: 13px; }
.account-bar button { margin-top: 0; min-height: 38px; padding: 8px 12px; font-size: 12px; }
.entry-creator { display: block; color: #648078; font-size: 11px; margin-top: 6px; }
body { background: radial-gradient(ellipse at 100% 0, #d7f7ec 0, transparent 45%), #f1f6f5; }
.brand-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: white;
  color: #103e3a;
  padding: 16px max(24px, calc((100vw - 1160px)/2));
  border-bottom: 1px solid #dceae5;
}
.brand-logo { display: block; width: min(640px, 72%); height: auto; }
.app-label { font-size: 11px; letter-spacing: .18em; font-weight: 700; }
main { max-width: 1160px; margin: 36px auto; }
.welcome { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.welcome h1 { font-size: clamp(28px, 3.5vw, 40px); letter-spacing: -.04em; margin: 12px 0; }
.welcome p { color: #5b746f; margin: 0; }
.eyebrow { color: #087b64; font-size: 11px; font-weight: 750; letter-spacing: .16em; }
.workspace-badge { border: 1px solid #bddfd2; border-radius: 999px; padding: 12px 18px; font-size: 11px; letter-spacing: .08em; white-space: nowrap; }
.notice { background: #e2f4ec; color: #286352; border: 1px solid #c6e7d9; font-size: 13px; border-radius: 9px; }
.grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 26px; align-items: start; }
.card { border: 1px solid #dce9e4; border-radius: 18px; box-shadow: 0 8px 30px #103e3a05; padding: 28px; }
.entry-card { border-top: 4px solid #17c79b; }
h2 { letter-spacing: -.025em; font-size: 24px; margin-top: 8px; }
label { color: #385c54; font-size: 13px; }
input, textarea, select { border-color: #d1e0da; background: #fafcfb; min-height: 46px; border-radius: 9px; }
textarea { min-height: 100px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid #19bd9290; outline-offset: 2px; background: white; }
button { background: #0a775f; color: white; border-radius: 9px; min-height: 44px; font-weight: 600; font-size: 14px; padding: 12px 18px; transition: background .15s, box-shadow .15s; }
button:hover:enabled { background: #065d4b; box-shadow: 0 3px 10px #07523c20; }
button:focus-visible { outline: 3px solid #19bd92; outline-offset: 3px; }
button.secondary { background: #eaf3ef; color: #285c4e; }
button.secondary:hover:enabled { background: #d8e9e1; }
#entryForm button[type=submit] { width: 100%; margin-top: 22px; }
.time-card { padding: 0; overflow: hidden; }
.stopwatch {
  position: relative;
  isolation: isolate;
  padding: 28px;
  color: #effff9;
  background: radial-gradient(ellipse at 110% 0, #146b58 0, transparent 65%), #093c35;
}
.stopwatch::before {
  content: '';
  position: absolute;
  z-index: -1;
  width: 250px;
  height: 250px;
  right: -135px;
  top: 60px;
  border: 1px solid #48dcb22b;
  border-radius: 50%;
  box-shadow: 0 0 0 26px #48dcb209, 0 0 0 52px #48dcb207;
}
.stopwatch-heading { display: flex; align-items: center; gap: 13px; }
.timer-icon { display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid #53d9b34a; border-radius: 15px; background: #72edbc12; color: #64f1bb; flex-shrink: 0; }
.timer-icon svg { width: 30px; height: 30px; }
.stopwatch .eyebrow { color: #7de4c3; font-size: 10px; }
.stopwatch h2 { color: #f3fff9; margin: 4px 0 0; font-size: 23px; }
.timer-status { display: inline-flex; align-items: center; gap: 8px; padding: 7px 11px; margin-top: 24px; border: 1px solid #a2d7c52b; border-radius: 999px; font-size: 12px; color: #c4e4d8; background: #041f2526; }
.status-dot { width: 7px; height: 7px; background: #91b7ab; border-radius: 50%; }
.timer { display: flex; justify-content: center; align-items: flex-start; gap: 7px; color: #f2fff9; font-size: clamp(34px, 4.3vw, 56px); font-weight: 650; letter-spacing: -.055em; background: transparent; border-radius: 0; padding: 26px 0 30px; margin: 0; text-align: center; }
.time-unit { min-width: 0; flex: 1; }
.time-unit>span { display: block; line-height: 1.15; font-variant-numeric: tabular-nums; }
.time-unit small { display: block; margin-top: 12px; color: #a1c9b9; font-size: 9px; font-weight: 500; letter-spacing: .14em; }
.time-colon { line-height: 1.05; font-weight: 300; color: #72a997; }
.time-unit.seconds>span { color: #66f2bd; }
.timer-actions { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 10px; }
.timer-actions button { margin: 0; min-height: 50px; border-radius: 12px; }
.timer-actions #start { background: #62efb9; color: #083f30; box-shadow: 0 5px 18px #00c3831a; }
.timer-actions #start:hover:enabled { background: #8bffcf; box-shadow: 0 5px 22px #00e59a30; }
.timer-actions #stop { background: #ffffff0c; border: 1px solid #b7e0d340; color: #e0f8ee; }
.timer-actions #stop:hover:enabled { background: #ffffff1c; }
.timer-actions button:disabled { opacity: .35; box-shadow: none; }
.play-icon, .stop-icon { margin-right: 6px; font-size: 12px; }
.timer-hint { font-size: 12px; color: #b3d4c7; margin: 16px 0 0; min-height: 36px; line-height: 1.5; }
.is-running .status-dot { background: #62efb9; box-shadow: 0 0 0 4px #62efb91a; animation: timer-pulse 2s ease-in-out infinite; }
.is-running .timer-status { color: #8effcf; border-color: #62efb94a; }
.billing-summary { padding: 28px; }
.billing-summary h2 { margin: 7px 0 12px; }
@keyframes timer-pulse { 50% { box-shadow: 0 0 0 7px #62efb908; } }
@media(prefers-reduced-motion:reduce) { .is-running .status-dot { animation: none; } }
@media(max-width:700px) { .card.time-card { padding: 0; } .stopwatch, .billing-summary { padding: 24px; } .timer { font-size: clamp(38px, 10vw, 64px); } }
.summary { font-size: 32px; color: #087b64; letter-spacing: -.025em; }
.muted { color: #648078; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; background: #f5f9f7; color: #56786d; }
td { padding: 16px 10px; color: #2f5149; }
tbody tr:hover { background: #f8fcfa; }
td:nth-child(2) { max-width: 340px; white-space: pre-wrap; overflow-wrap: anywhere; }
td:nth-child(4) { color: #087b64; font-weight: 600; }
td button { margin: 3px; min-height: 40px; }
dialog { padding: 32px; border-radius: 18px; box-shadow: 0 24px 100px #063d3b50; }
.report-logo { display: block; width: 100%; height: auto; margin: 0 0 24px; }
.report-lines { line-height: 1.7; color: #294b43; }
#signatureImage { width: 100%; max-height: 160px; object-fit: contain; object-position: left; }
canvas { border-color: #7aac99; border-radius: 9px; }
.entry-select { width: 22px; min-height: 22px; height: 22px; vertical-align: middle; accent-color: #0a775f; }
.entry-choice { display: flex; align-items: center; gap: 8px; margin: 4px 0 8px; font-size: 12px; font-weight: 400; }
.entry-select:disabled { opacity: .5; }
.bundle-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px 0; border-bottom: 1px solid #dce9e4; }
.bundle-row span { flex: 1; min-width: 180px; }
.material-row { border: 1px solid #dce9e4; border-radius: 10px; padding: 14px; margin: 12px 0; display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.material-row label { margin: 0; }
@media(max-width:500px) { .material-row { grid-template-columns: 1fr; } }
@media(max-width:700px) {
  .brand-header { padding: 12px 16px; gap: 8px; }
  .brand-logo { width: 100%; }
  .app-label, .workspace-badge { display: none; }
  main { margin: 26px auto; padding: 0 14px; }
  .welcome { margin-bottom: 20px; }
  .grid { grid-template-columns: 1fr; gap: 0; }
  .card { padding: 22px 18px; }
  dialog { padding: 22px; }
}
@media print {
  body { background: white; }
  .report-logo { display: block !important; margin-bottom: 20px; }
  dialog { max-width: none; max-height: none; overflow: visible; }
}
/* Tablet portrait and split-screen get a full-width form and timer. */
@media screen and (max-width: 1000px) {
  .grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .welcome { flex-wrap: wrap; }
  .workspace-badge { display: none; }
  .timer { max-width: 480px; margin-inline: auto; font-size: clamp(38px, 7vw, 64px); }
  .timer-actions { max-width: 480px; margin-inline: auto; }
  .account-bar > div { display: flex; flex-wrap: wrap; gap: 8px; }
  .account-bar button { margin: 0; min-height: 44px; }
  input, select, textarea { font-size: 16px; }
}
/* Every field stays visible when the table becomes a list of cards. */
@media screen and (max-width: 900px) {
  .entries-container { overflow: visible; }
  .entries-table, .entries-table tbody { display: block; width: 100%; }
  .entries-table thead { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .entries-table tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); margin: 16px 0; border: 1px solid #dce9e4; border-radius: 12px; padding: 14px; background: #fbfdfc; }
  .entries-table td, .entries-table td:nth-child(3) { display: block; min-width: 0; max-width: none; padding: 10px 6px; border: 0; }
  .entries-table td::before { content: attr(data-label); display: block; color: #648078; font-size: 11px; font-weight: 650; letter-spacing: .05em; margin-bottom: 6px; }
  .entries-table td:first-child, .entries-table td:nth-child(2), .entries-table td:last-child { grid-column: 1 / -1; }
  .entries-table td:first-child { font-weight: 650; border-bottom: 1px solid #dce9e4; }
  .entries-table td:last-child { border-top: 1px solid #dce9e4; }
  .entries-table button { min-height: 44px; }
  .bundle-row > span { flex-basis: 100%; min-width: 0; }
}
@media screen and (max-width: 600px) {
  .row, .material-row { grid-template-columns: minmax(0, 1fr); }
  dialog { width: calc(100% - 20px); padding: 20px; }
  dialog h1 { font-size: 26px; overflow-wrap: anywhere; }
  dialog button { max-width: 100%; white-space: normal; }
  .login-shell { padding: 16px 12px; }
  .login-shell .card { padding: 22px 18px; }
}
@media screen and (max-width: 380px) {
  .timer-actions { grid-template-columns: minmax(0, 1fr); }
}
@media screen and (max-width: 1366px), screen and (pointer: coarse) {
  .date-duration-row { grid-template-columns: minmax(0, 1fr); }
}
