/* Smart Notebook: shared controls and screen styles.

Source order and selector specificity are intentional. Responsive rules stay
with their cascade context; settings.css loads after this file. Classes added
by the runtime scripts are part of the styling contract. */
:root {
  --sn-radius: 12px;
  --sn-background: #f5f3f1;
  --sn-surface: #f6f4f2;
  --sn-text: #292929;
  --sn-muted: #666462;
  --sn-line: #dedbd8;
  --sn-segment: #edebe9;
  --sn-selected: #e6e3e1;
  --sn-control: 44px;
}
body {
  margin: 0;
}
.app {
  margin: auto;
}
.top {
  border-bottom: 1px solid #e0e2e4;
  background: var(--sn-background);
  justify-content: space-between;
}
.brand {
  font-size: 16px;
  font-weight: 600;
}
.topbtn {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: #424242;
  cursor: pointer;
  padding: 4px 0;
  font-size: 12px;
  white-space: nowrap;
}
.topbtn svg {
  width: 17px;
  height: 17px;
  stroke: #444;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.main {
  padding: 16px 30px 40px;
  max-width: 900px;
}
h1 {
  font-size: 16px;
  line-height: 22px;
  margin: 0 0 13px 4px;
  font-weight: 700;
}
.search {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
}
.search svg {
  width: 16px;
  height: 16px;
  stroke: #a4a4a4;
  fill: none;
  stroke-width: 1.8;
}
.search input {
  width: 100%;
  font:
    12px Arial,
    sans-serif;
  color: #333;
}
.search input::placeholder {
  color: #a3a3a3;
}
.group {
  margin-top: 13px;
}
.datehead {
  letter-spacing: 0.1px;
  font-weight: 500;
  margin: 0 0 10px 4px;
  text-transform: uppercase;
}
.note {
  position: relative;
  border: 1px solid #e5e5e5;
  cursor: pointer;
}
.note:focus-visible,
.dots:focus-visible {
  outline: 2px solid #777;
  outline-offset: 2px;
}
.note-title {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.note-preview {
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.note-date {
  top: 16px;
  right: 61px;
}
.dots {
  right: 15px;
  top: 20px;
  background: none;
  border: 0;
  color: #aaa;
  font-size: 18px;
  line-height: 16px;
  letter-spacing: 1px;
  cursor: pointer;
  padding: 0 3px;
}
.menu {
  position: absolute;
  z-index: 4;
  background: #fff;
  border: 1px solid #e2e2e2;
  border-radius: 10px;
  box-shadow: 0 6px 20px #0002;
  min-width: 125px;
  padding: 5px;
}
.menu button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: white;
  padding: 9px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
}
.menu button:hover {
  background: #f5f5f5;
}
.hidden {
  display: none !important;
}
.empty {
  color: #999;
  font-size: 13px;
  margin: 24px 4px;
}
.overlay {
  position: fixed;
  inset: 0;
  background: #0003;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 10;
}
.dialog {
  background: white;
  border-radius: 16px;
  padding: 22px;
  width: min(360px, 100%);
  box-shadow: 0 12px 35px #0002;
}
.dialog h2 {
  font-size: 17px;
  margin: 0 0 12px;
}
.dialog p {
  line-height: 1.6;
  white-space: pre-wrap;
  color: #766866;
}
.dialog button {
  border: 1px solid #ddd;
  background: white;
  border-radius: 9px;
  padding: 8px 15px;
  cursor: pointer;
}
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: white;
  padding: 10px 16px;
  border-radius: 9px;
  font-size: 12px;
  z-index: 20;
  white-space: nowrap;
}
@media (min-width: 650px) {
  .app {
    border-left: 1px solid #f4f4f4;
    border-right: 1px solid #f4f4f4;
    min-height: 100vh;
  }
}
@media (max-width: 370px) {
  .brand {
    font-size: 15px;
  }
}

.heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 13px 4px;
}
.heading-row h1 {
  margin: 0;
}
.new-note-btn {
  display: grid;
  place-items: center;
  border: 1px solid #e5e5e5;
  background: #fafafa;
  color: #555;
  cursor: pointer;
  flex-shrink: 0;
}
.new-note-btn svg {
  stroke: currentColor;
  stroke-width: 1.7;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.new-note-btn:focus-visible {
  outline: 2px solid #777;
  outline-offset: 2px;
}
.create {
  padding: 18px 30px 42px;
}
.create[hidden] {
  display: none !important;
}
.create-body {
  display: block;
  width: 100%;
  resize: vertical;
  font: 14px/1.75 Arial;
  padding: 8px 3px;
  color: #333;
}
.create-body::placeholder {
  color: #aaa;
}
.no-data {
  border: 1px solid #e8e8e8;
  border-radius: 12px;
  padding: 18px;
  color: #888;
  font-size: 13px;
  line-height: 1.6;
}
.pdf-unavailable {
  color: #888;
  font-size: 13px;
  line-height: 1.6;
  padding: 18px 0;
}
@media (max-width: 370px) {
  .create {
    padding-left: 18px;
    padding-right: 18px;
  }
}
.detail-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 0;
  padding: 5px 3px;
  font: 12px Arial;
  cursor: pointer;
  margin-bottom: 18px;
}
.detail-back svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}
.detail h1 {
  margin: 0 0 19px 3px;
  overflow-wrap: anywhere;
}
.tabs {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-bottom: 1px solid #e5e5e5;
  gap: 0;
  margin-bottom: 23px;
}
.tab {
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: #999;
  font: 13px Arial;
  padding: 12px 3px;
  cursor: pointer;
}
.tab[aria-selected="true"] {
  color: #191919;
  font-weight: 600;
  border-bottom-color: #333;
}
.primary {
  background: #242424;
  color: #fff;
  border: 1px solid #242424;
  border-radius: 10px;
  padding: 11px 17px;
  font: 12px Arial;
  cursor: pointer;
  margin-top: 16px;
}
.secondary {
  background: white;
  color: #333;
  border: 1px solid #dedede;
  border-radius: 10px;
  padding: 10px 14px;
  font: 12px Arial;
  cursor: pointer;
}
.work-card {
  padding: 15px;
  margin-bottom: 13px;
}
.work-card h2 {
  font-size: 13px;
  margin: 0 0 13px;
}
.fieldrow {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin: 10px 0;
}
.field {
  width: 100%;
  padding: 9px 10px;
  color: #333;
  background: #fff;
  font: 12px Arial;
  outline: none;
}
.total {
  border-top: 1px solid #e8e8e8;
  margin-top: 18px;
  padding-top: 16px;
  font-size: 14px;
  font-weight: 700;
  text-align: right;
}
.a4-wrap {
  background: #f5f5f5;
  border: 1px solid #e9e9e9;
  border-radius: 12px;
  padding: 13px;
  overflow: hidden;
}
.a4-wrap canvas {
  display: block;
  width: 100%;
  height: auto;
  background: white;
  box-shadow: 0 1px 7px #00000014;
}
.pdf-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}
.detail[hidden],
.main[hidden] {
  display: none !important;
}
@media (max-width: 370px) {
  .fieldrow {
    grid-template-columns: 92px minmax(0, 1fr);
  }
}

/* Note attachments */
.attach-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}
.attach-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 10px;
  font: 12px Arial;
  cursor: pointer;
}
.attach-trigger svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.attachment-list {
  display: grid;
  gap: 9px;
  margin: 9px 0 15px;
}
.attachment {
  display: flex;
  align-items: center;
  gap: 11px;
  border: 1px solid #e7e7e7;
  border-radius: 12px;
  padding: 9px;
  min-width: 0;
}
.attachment-preview {
  width: 47px;
  height: 47px;
  object-fit: cover;
  border-radius: 8px;
  background: #f4f4f4;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  color: #777;
}
.attachment-info {
  min-width: 0;
  flex: 1;
}
.attachment-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #333;
  font-size: 12px;
  text-decoration: none;
}
.attachment-name:hover {
  text-decoration: underline;
}
.attachment-size {
  font-size: 11px;
  color: #999;
  margin-top: 5px;
}
.attachment-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.attachment-controls button,
.attachment-controls a {
  border: 1px solid #e4e4e4;
  background: #fff;
  border-radius: 8px;
  padding: 7px 9px;
  color: #444;
  font: 11px Arial;
  text-decoration: none;
  cursor: pointer;
}
.attachment-controls .remove-file {
  font-size: 17px;
  padding: 5px 9px;
}
.attachment-error {
  font-size: 12px;
  color: #9d3535;
  line-height: 1.5;
  margin: 7px 0;
}
.note-clip {
  display: inline-flex;
  vertical-align: middle;
  margin-left: 7px;
  color: #999;
}
.note-clip svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}
.create-body {
  min-height: 220px;
}
@media (max-width: 440px) {
  .attachment {
    flex-wrap: wrap;
  }
  .attachment-controls {
    width: 100%;
    padding-left: 58px;
  }
  .attachment-name {
    max-width: 100%;
  }
}

/* Calendar grid and report list */
.calendar-screen[hidden] {
  display: none !important;
}
.calendar-heading {
  font-weight: 700;
  margin: 4px 0 18px;
}
.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.calendar-month {
  text-transform: capitalize;
}
.calendar-arrow {
  width: 36px;
  height: 36px;
  color: #333;
  font-size: 23px;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.calendar-week,
.calendar-days {
  display: grid;
}
.calendar-week span {
  text-align: center;
}
.calendar-day {
  position: relative;
  min-width: 0;
  color: #333;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.calendar-day .day-count {
  white-space: nowrap;
}
.calendar-day.today:not(.selected) {
  outline-offset: -1px;
}
.calendar-arrow:focus-visible,
.calendar-clear:focus-visible {
  outline: 2px solid #777;
  outline-offset: 2px;
}
.calendar-blank {
  min-width: 0;
}
.calendar-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.calendar-selection {
  line-height: 1.5;
}
.calendar-clear {
  border-radius: 9px;
  cursor: pointer;
}
.calendar-summary {
  justify-content: space-between;
}
.calendar-summary h2 {
  margin: 0;
}
.calendar-report {
  border: 1px solid #e7e7e7;
}
.calendar-report h3 {
  margin: 0 0 6px;
}
.calendar-report p {
  margin: 0;
}
.calendar-no-results {
  border: 1px solid #ececec;
  border-radius: 12px;
  padding: 18px;
  color: #888;
  font-size: 12px;
  line-height: 1.6;
}

.pdf-screen {
  padding: 19px 30px 48px;
}
.pdf-screen[hidden] {
  display: none !important;
}
.pdf-screen h1 {
  font-size: 18px;
  margin: 5px 0 8px;
}
.pdf-summary {
  color: #8b8583;
  font-size: 12px;
  margin-bottom: 20px;
}
.report-card {
  border: 1px solid #e5e5e5;
  padding: 16px;
  margin: 12px 0;
  background: #fff;
}
.report-card h3 {
  font-size: 14px;
  margin: 0 0 8px;
}
.report-meta {
  font-size: 12px;
  line-height: 1.7;
}
.report-buttons {
  margin-top: 13px;
}
.report-buttons button {
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 9px;
  padding: 9px 12px;
  font: 12px Arial;
  color: #333;
  cursor: pointer;
}
.work-tools button {
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 9px;
  padding: 9px 12px;
  font: 12px Arial;
  color: #333;
}
.report-buttons button:first-child {
  background: #292929;
  color: white;
  border-color: #292929;
}
.pdf-empty {
  border: 1px dashed #ddd;
  border-radius: 15px;
  padding: 24px 18px;
  color: #888;
  line-height: 1.6;
  font-size: 13px;
}
.work-tools {
  margin: 12px 0;
}
.report-card small {
  color: #999;
}

/* Report actions and preview shell */
.report-buttons {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.report-buttons button {
  min-height: 36px;
}
.pdf-preview-overlay {
  justify-content: center;
}
.pdf-preview-header {
  align-items: center;
  justify-content: space-between;
}

.analysis-status {
  font-size: 12px;
  color: #766e69;
  line-height: 1.55;
  margin: 8px 0 13px;
}
.work-card {
  position: relative;
}
.work-card .remove-row {
  border: 1px solid #e3e3e3;
  background: white;
  border-radius: 8px;
  color: #666;
  padding: 6px 9px;
  font-size: 11px;
  cursor: pointer;
  float: right;
}
.field.needs-review {
  border-color: #d9bb8e;
  background: #fffdf8;
}
.work-default-date {
  font-size: 11px;
  color: #947d59;
  margin: 4px 0 8px;
}
.work-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.work-tools button {
  cursor: pointer;
}
.work-card h2 {
  display: inline-block;
}
.analysis-status.confirmed {
  color: #386b4b;
}
.flow-message {
  border: 1px solid #d7e7d9;
  background: #f7fbf7;
  color: #386b4b;
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 12px;
  line-height: 1.5;
}
.work-tools button[hidden] {
  display: none;
}

/* Compact work summary */
.quick-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.quick-head h2 {
  margin: 0;
}
.quick-status {
  line-height: 1.5;
}
.quick-actions {
  align-items: center;
}
.quick-actions .primary,
.quick-actions .secondary {
  margin-top: 5px;
}
.quick-question {
  font-size: 12px;
  color: #875b30;
}
.compact-summary {
  display: flex;
  justify-content: space-between;
  border: 1px solid #e8e8e8;
}
.compact-lines {
  min-width: 0;
  flex: 1;
}
.compact-line {
  display: block;
  width: 100%;
  border: 0;
  background: none;
  text-align: left;
  font: 14px/1.5 Arial;
  color: #262626;
  overflow-wrap: anywhere;
  cursor: pointer;
}
.compact-summary strong {
  white-space: nowrap;
}
.quick-question {
  margin-bottom: 8px !important;
}
/* Mobile-first note workflow: one readable summary, no form-like chip grid. */
.detail {
  padding: 20px clamp(16px, 4vw, 30px) 48px;
}
.detail h1 {
  margin-bottom: 18px;
}
.tabs {
  display: none;
}
.quick-work {
  border-top: 1px solid #eee;
}
.quick-status {
  margin: 10px 0 18px;
}
.quick-question:not([hidden]) {
  background: #f9f8f5;
  border: 0;
  border-radius: 12px;
  padding: 15px;
  font-weight: 600;
  font-size: 14px;
  color: #333;
  margin: 12px 0;
}
.quick-actions {
  display: flex;
}
.attach-tools {
  margin: 4px 0 16px;
}
.attach-trigger {
  border: 0;
  background: transparent;
  padding: 8px 0;
  color: #777;
}
.pdf-actions {
  flex-wrap: wrap;
  gap: 8px;
}
#pane-data,
#pane-pdf {
  margin-top: 12px;
}
@media (max-width: 440px) {
  .topbtn {
    font-size: 11px;
  }
  .detail {
    padding: 18px 18px 40px;
  }
}
.report-card-new {
  border-color: #8f8f8f;
  box-shadow: 0 0 0 1px #e7e7e7;
}
.report-buttons button:focus-visible {
  outline: 2px solid #777;
  outline-offset: 2px;
}

/* Attachments belong to the report card and remain compact on narrow screens. */
.report-attachments {
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px solid #efefef;
}
.report-attachment-heading {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.report-attach-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 8px 11px;
}
.report-attach-trigger svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.report-attachment-list {
  display: grid;
  gap: 8px;
  margin-top: 9px;
}
.report-attachment-list:empty {
  display: none;
}
.report-attachment-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 8px 0;
  border-bottom: 1px solid #f3f3f3;
}
.report-attachment-name {
  min-width: 0;
  flex: 1;
  overflow-wrap: anywhere;
  font-size: 12px;
  color: #444;
  line-height: 1.45;
}
.report-attachment-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.report-attachment-actions button {
  border: 1px solid #e5e5e5;
  background: #fff;
  border-radius: 8px;
  padding: 7px 9px;
  font: 11px Arial;
  color: #444;
  cursor: pointer;
}
.report-attachment-error {
  font-size: 12px;
  color: #9d3535;
  line-height: 1.5;
  margin: 8px 0 0;
}
.report-attachment-error:empty {
  display: none;
}
@media (max-width: 440px) {
  .report-attachment-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }
  .report-attachment-actions {
    justify-content: flex-start;
  }
}

.work-card label.fieldrow > span {
  color: #706966;
}
.work-card .fieldrow .field {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.work-card [data-jan][hidden] {
  display: none;
}
.report-hint {
  display: block;
  flex-basis: 100%;
  font-size: 12px;
  color: #625f5e;
  margin: 6px 0;
}
.work-card [data-jan-hint] {
  display: block;
  font-size: 12px;
  color: #625f5e;
}
.work-card [data-jan-hint][hidden] {
  display: none;
}
.note-save-bar small {
  color: #595959;
}
.quick-status[hidden] {
  display: none;
}

.pdf-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.pdf-heading .topbtn {
  width: 44px;
  height: 44px;
  justify-content: center;
}
.pdf-heading h1 {
  margin-block: 0;
}

#period-preview {
  margin: 12px 0;
}

button.calendar-month {
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
}
button.calendar-month[aria-pressed="true"] {
  background: #eee;
}

.preview-attachments {
  min-width: 0;
  margin: 12px 0;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 10px;
}
.preview-attachments div {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 6px 0;
}
.preview-attachments button,
.preview-attachments label {
  font: inherit;
  color: inherit;
  overflow-wrap: anywhere;
  max-width: 100%;
}
.pdf-preview-overlay {
  box-sizing: border-box;
}
.pdf-preview-header {
  flex: none;
}

/* Compact mobile-first report preview, consistent with the notebook. */
.pdf-preview-overlay {
  align-items: center;
}
.pdf-preview-panel {
  flex-direction: column;
}
.pdf-preview-header button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  flex: none;
  border: 1px solid #e2e2e2;
  background: #fff;
  color: #333;
  border-radius: 10px;
  padding: 9px 12px;
  font:
    13px Arial,
    sans-serif;
  cursor: pointer;
}
#pdf-preview-visual {
  min-height: 0;
  overscroll-behavior: contain;
}
.pdf-preview-page {
  display: block;
  height: auto;
  background: #fff;
  box-shadow: 0 3px 18px #00000012;
}
.preview-report-actions {
  justify-content: center;
}
.preview-report-actions + .secondary {
  min-height: 44px;
}

.pdf-preview-overlay .preview-attachments {
  max-width: 570px;
  margin: 10px auto 12px;
  background: #fff;
}
.pdf-preview-overlay button:focus-visible {
  outline: 2px solid #444;
  outline-offset: 2px;
}
@media (max-width: 520px) {
  .pdf-preview-header button {
    padding: 8px 10px;
  }
}

/* Note editor: calm typography, compact spacing and accessible keyboard focus. */
.detail #pane-note .editor {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  outline: 0;
  color: #333;
  font:
    15px/1.6 Arial,
    Helvetica,
    sans-serif;
}
.detail #pane-note .editor:focus,
.detail #pane-note .editor:focus-visible {
  outline: none;
  border: 0;
  box-shadow: none;
}
.detail #pane-note .note-save-bar .primary {
  margin: 0;
  min-height: 42px;
}
@media (max-width: 440px) {
  .detail {
    padding-top: 14px;
  }
  .detail .detail-back {
    margin-bottom: 12px;
  }
  .detail h1 {
    margin-bottom: 8px;
  }
}

/* Attachment drawer: compact by default, usable with dozens of files. */
.pdf-preview-overlay details.preview-attachments {
  display: block;
  max-width: 570px;
  margin: 10px auto 14px;
  padding: 0;
  border: 1px solid #e3e3e3;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}
.preview-attachments > summary {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 12px 14px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  list-style: none;
}
.preview-attachments > summary::-webkit-details-marker {
  display: none;
}
.preview-attachments > summary:before {
  content: "▸";
  color: #777;
  font-size: 13px;
  transition: transform 0.15s;
}
.preview-attachments[open] > summary:before {
  transform: rotate(90deg);
}
.preview-attachment-count {
  margin-left: auto;
  padding: 3px 8px;
  border-radius: 20px;
  background: #f1f1f1;
  color: #555;
  font-size: 12px;
  font-weight: 500;
}
.preview-attachments .preview-attachment-list {
  display: block;
  padding: 0;
  max-height: 245px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-top: 1px solid #eee;
}
.preview-attachments .preview-attachment-item {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 7px 12px;
  border-bottom: 1px solid #f0f0f0;
  min-width: 0;
}
.preview-attachment-item:last-child {
  border-bottom: 0;
}
.preview-attachments .preview-attachment-info {
  display: block;
  flex: 1;
  min-width: 0;
  padding: 0;
}
.preview-sharing-hint {
  margin: 0;
  padding: 0 14px 10px;
  color: #666;
  font-size: 12px;
}
.preview-attachments .preview-attachment-name {
  display: block;
  flex: 1;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 0;
  background: transparent;
  padding: 9px 0;
  text-align: left;
  font: 12px Arial;
  color: #333;
  cursor: pointer;
}
.preview-attachment-share {
  display: flex;
  align-items: center;
  gap: 3px;
  flex: none;
  font-size: 12px;
  white-space: nowrap;
}
.preview-attachments .preview-attachment-download,
.preview-attachments .preview-attachment-send {
  flex: none;
  min-width: 44px;
  min-height: 44px;
  padding: 8px;
  border: 1px solid #e5e5e5;
  border-radius: 9px;
  font-size: 18px;
  color: #333;
  background: #fff;
}
.preview-attachments .preview-attachment-send {
  font-size: 12px;
}

/* Keep the correction action visible even when a period report spans many pages. */
.pdf-preview-header #pdf-preview-edit {
  flex: none;
  background: #252525;
  color: #fff;
  border-color: #252525;
  font-weight: 600;
}
.pdf-preview-header #pdf-preview-edit[hidden] {
  display: none !important;
}
@media (max-width: 520px) {
  .pdf-preview-header #pdf-preview-edit {
    padding: 8px 10px;
    font-size: 12px;
  }
}

/* Compact report actions in calendar: one tidy row, touch-friendly icon controls. */
.calendar-report {
  margin-bottom: 9px;
}
.calendar-report h3 {
  margin-bottom: 7px;
}
.calendar-report p {
  margin-top: 3px;
}
.calendar-report-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 40px;
  height: 40px;
  padding: 0 11px;
  border: 1px solid #e2e2e2;
  border-radius: 10px;
  background: #fff;
  color: #343434;
  font:
    12px Arial,
    sans-serif;
  white-space: nowrap;
}

.calendar-report-actions button svg {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.calendar-report-actions button:focus-visible {
  outline: 2px solid #555;
  outline-offset: 2px;
}
@media (max-width: 440px) {
  .calendar-report-actions button {
    min-height: 42px;
    height: 42px;
  }
}

/* Precise, two-step editing of a row from a long PDF. */
.pdf-preview-selectable {
  cursor: pointer;
}
.pdf-row-picker {
  flex: none;
  border-top: 1px solid #e7e7e7;
}
.pdf-row-picker[hidden] {
  display: none !important;
}
.pdf-row-picker-nav {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  gap: 8px;
}
.pdf-row-picker-nav button,
.pdf-row-picker-nav select {
  min-height: 44px;
  border: 1px solid #ddd;
  border-radius: 9px;
  background: white;
  color: #333;
  font: 13px Arial;
}
.pdf-row-picker-nav button {
  font-size: 22px;
}
.pdf-row-picker-nav button:disabled {
  opacity: 0.35;
}
.pdf-row-picker-nav select {
  width: 100%;
  padding: 0 8px;
  min-width: 0;
}
.pdf-row-summary {
  font-size: 12px;
  color: #666;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 9px 0;
}
.pdf-row-picker-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.pdf-row-picker-actions button {
  min-height: 42px;
  border: 1px solid #ddd;
  border-radius: 9px;
  padding: 9px 13px;
  background: white;
  color: #333;
  font: 12px Arial;
}
#pdf-row-edit {
  background: #252525;
  color: white;
  border-color: #252525;
}

/* Shared typography, surfaces and touch targets. */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 15px;
}
.top {
  padding-inline: 16px;
}
.topbtn {
  min-width: 44px;
  min-height: 44px;
  justify-content: center;
  border-radius: 10px;
}
.topbtn:focus-visible {
  outline: 2px solid #555;
  outline-offset: 2px;
}
.main,
.detail,
.calendar-screen,
.pdf-screen {
  padding-left: 16px;
  padding-right: 16px;
}
.main h1,
.detail h1,
.calendar-heading {
  font-size: 21px;
  line-height: 1.3;
}
.note {
  margin-bottom: 9px;
  min-height: 68px;
  border-color: var(--sn-line);
  border-radius: 12px;
  box-shadow: none;
}
.note-title {
  font-size: 15px;
  line-height: 1.45;
}
.note-preview {
  font-size: 14px;
  line-height: 1.45;
  color: var(--sn-muted);
}
.note-date {
  color: var(--sn-muted);
}
.datehead {
  font-size: 12px;
  color: var(--sn-muted);
}
.search {
  min-height: 44px;
  height: 44px;
  border: 1px solid #dfe3e6;
  border-radius: 11px;
  background: #fff;
  box-shadow: none;
}
.search:focus-within {
  border-color: #77818b;
}
.search input {
  font-size: 16px;
  border: 0;
  outline: 0;
  box-shadow: none;
  background: transparent;
  min-width: 0;
}
.search input:focus,
.search input:focus-visible {
  border: 0;
  outline: 0;
  box-shadow: none;
}
.dots {
  min-width: 44px;
  min-height: 44px;
}
.calendar-report {
  padding: 12px 13px;
  border-color: var(--sn-line);
  border-radius: 12px;
}
.calendar-report h3 {
  font-size: 15px;
  line-height: 1.4;
}
.calendar-report p {
  font-size: 13px;
  color: var(--sn-muted);
  line-height: 1.45;
}
.calendar-report-actions {
  margin-top: 10px;
}
.calendar-report-actions > button {
  width: auto !important;
}

.report-card {
  border-color: var(--sn-line);
  box-shadow: none;
  border-radius: 12px;
}
.field {
  font-size: 16px;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: none;
  border: 1px solid #dfe3e6;
  border-radius: 9px;
}
.field:focus,
.field:focus-visible {
  outline: 0;
  border-color: #77818b;
  box-shadow: 0 0 0 1px #77818b;
}
.work-card label.fieldrow > span {
  font-size: 13px;
}
.report-meta {
  color: var(--sn-muted);
}
@media (max-width: 440px) {
  .main,
  .detail,
  .calendar-screen,
  .pdf-screen {
    padding-left: 16px;
    padding-right: 16px;
  }
  .top {
    padding-inline: 12px;
  }
}
.calendar-week-select-wrap {
  display: flex;
  align-items: center;
}
.calendar-week-select-wrap select {
  color: #34383e;
  border-radius: 9px;
  padding: 0 9px;
  font:
    13px -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Arial,
    sans-serif;
}

/* Shared controls and responsive screen geometry. */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body,
.app {
  max-width: 100%;
  min-width: 0;
}
body {
  background: var(--sn-background);
  color: var(--sn-text);
}
button,
input,
textarea,
select {
  font-family: inherit;
}
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid #77818b;
  outline-offset: 1px;
}
.create,
.detail {
  width: 100%;
  max-width: 900px;
  margin-inline: auto;
  padding-inline: 16px;
}
.settings-screen {
  width: 100%;
}
.calendar-screen,
.pdf-screen {
  width: 100%;
  max-width: 900px;
  margin-inline: auto;
  padding-inline: 16px;
}
.create-body,
.editor,
.field,
.settings-card input {
  min-width: 0;
  max-width: 100%;
}
.create-body {
  font-family: inherit;
  font-size: 16px;
  line-height: 1.55;
}
.create-body {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  outline: 0;
}
.create-body:focus,
.create-body:focus-visible {
  border: 0;
  outline: 0;
  box-shadow: none;
}
.note-save-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}
.settings-card button,
.work-tools button,
.attach-trigger,
.quick-actions button,
.detail-back {
  min-height: 44px;
}
.detail-back {
  font-size: 14px;
  color: var(--sn-text);
}
.settings-card {
  box-shadow: none;
}
.work-card {
  border: 1px solid var(--sn-line);
  border-radius: 12px;
  box-shadow: none;
}
.fieldrow label {
  font-size: 14px;
  color: var(--sn-muted);
}
.quick-status {
  font-size: 13px;
  color: var(--sn-muted);
}
.quick-work:not(.has-work) .quick-head,
.quick-work:not(.has-work) #quick-status {
  display: none;
}
.quick-work:not(.has-work) .quick-actions button {
  min-height: 44px;
  padding: 8px 12px;
  border: 0;
  background: transparent;
  font-size: 13px;
  color: var(--sn-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}
#note-save-status {
  font-size: 13px;
  color: var(--sn-muted);
}
#save-edits[hidden] {
  display: none !important;
}
.calendar-week {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}
.calendar-day .day-count {
  letter-spacing: -0.01em;
}

.calendar-report-actions {
  min-width: 0;
}
.calendar-report h3,
.calendar-report p,
.report-card h3 {
  overflow-wrap: anywhere;
}
.pdf-preview-header {
  min-width: 0;
  gap: 7px;
}
.pdf-preview-header button {
  min-width: 44px;
  min-height: 44px;
}

.pdf-row-picker {
  max-width: 100%;
  min-width: 0;
}
@media (max-width: 370px) {
  .calendar-screen {
    padding-inline: 0;
  }
  .create,
  .detail {
    padding-inline: 12px;
  }
}

.calendar-object-search {
  margin: 0 0 14px;
  position: relative;
}
.calendar-object-search > label {
  display: block;
  font-size: 12px;
  color: #646a72;
}
.calendar-object-input {
  display: flex;
  align-items: center;
  border: 1px solid #e1e4e7;
  background: #fff;
  overflow: hidden;
}
.calendar-object-input:focus-within {
  border-color: #77818b;
}
.calendar-object-input input {
  width: 100%;
  min-width: 0;
  padding: 0 12px;
  border: 0;
  outline: 0;
  box-shadow: none;
  background: transparent;
  font:
    14px -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Arial,
    sans-serif;
}
.calendar-object-input button {
  width: 44px;
  min-width: 44px;
  border: 0;
  background: transparent;
  color: #626970;
  font-size: 22px;
}
.calendar-object-input button[hidden],
.calendar-object-results[hidden] {
  display: none !important;
}
.calendar-object-results {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 8;
  margin-top: 5px;
  padding: 5px;
  border: 1px solid #e1e4e7;
  border-radius: 11px;
  background: white;
  box-shadow: 0 8px 20px #00000015;
  max-height: 260px;
  overflow: auto;
}
.calendar-object-results button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  width: 100%;
  padding: 10px 11px;
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  background: white;
  text-align: left;
}
.calendar-object-results button:hover,
.calendar-object-results button:focus-visible {
  background: #f3f4f5;
}
.calendar-object-results strong {
  font-size: 14px;
  font-weight: 600;
  color: #25282c;
}
.calendar-object-results span,
.calendar-object-results p {
  font-size: 12px;
  color: #646a72;
  margin: 0;
}

/* Android: prevent long-press text selection and blue tap flash on report actions. */
.calendar-report-actions,
.calendar-report-actions button {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

.calendar-report-actions button {
  touch-action: manipulation;
}
.calendar-report-actions button::selection {
  background: transparent;
}

/* Calendar: compact mobile hierarchy and light, accessible seven-day grid. */
.calendar-screen {
  padding-top: 8px;
  padding-bottom: 28px;
}
.calendar-screen > .detail-back {
  margin-bottom: 2px;
  min-height: 40px;
}
.calendar-object-search > label {
  margin-bottom: 4px;
}
.calendar-card {
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
}
.calendar-nav {
  margin: 0 0 6px;
  gap: 8px;
}
.calendar-month {
  font-size: 16px;
  font-weight: 650;
  min-height: 42px;
}
.calendar-arrow {
  min-width: 44px;
  min-height: 44px;
  border: 0;
  background: transparent;
  border-radius: 10px;
}
.calendar-week {
  margin-bottom: 3px;
  gap: 3px !important;
}
.calendar-week span {
  font-size: 12px;
  color: #636971;
  padding: 4px 0 5px;
}
.calendar-days {
  gap: 3px !important;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}
.calendar-day {
  min-height: 44px !important;
  height: 44px;
  aspect-ratio: auto !important;
  gap: 0;
  padding: 2px 0 !important;
  border: 1px solid transparent;
  background: transparent !important;
  border-radius: 9px !important;
}
.calendar-day .day-number {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
}
.calendar-day .day-count {
  font-size: 10px;
  line-height: 1.1;
  color: #666f77;
}
.calendar-day:has(.day-count) {
  gap: 2px;
  background: #f6f7f8 !important;
}
.calendar-day.today:not(.selected) {
  border-color: #b5bcc4;
  outline: none;
}
.calendar-day.selected,
.calendar-day.selected:has(.day-count) {
  background: #25282c !important;
  border-color: #25282c;
  color: #fff;
}
.calendar-day.selected .day-count {
  color: #e4e8ec;
}
.calendar-day:focus-visible {
  outline: 2px solid #3e4a57;
  outline-offset: 1px;
}
.calendar-week-select-wrap {
  margin: 9px 0 0 !important;
  justify-content: flex-start;
  gap: 8px;
  min-height: 40px;
}
.calendar-week-select-wrap label {
  font-size: 12px;
  color: #646a72;
}
.calendar-week-select-wrap select {
  min-height: 40px;
  max-width: 190px;
  background: white;
  font-size: 13px;
}
.calendar-bottom {
  margin-top: 4px;
  padding: 0 !important;
  gap: 6px;
  min-height: 31px;
  flex-wrap: wrap;
}
.calendar-selection {
  font-size: 12px;
  color: #646a72;
}
.calendar-clear {
  min-height: 36px;
  padding: 6px 10px;
  border: 0;
  background: transparent;
  color: #424850;
  font-size: 12px;
}
.calendar-clear[hidden] {
  display: none !important;
}
.calendar-bottom #calendar-clear {
  margin-left: auto;
}
.calendar-summary {
  margin: 13px 0 9px !important;
  padding-top: 11px;
  border-top: 1px solid #eceef0;
  gap: 7px;
}
.calendar-summary h2 {
  line-height: 1.3;
  font-weight: 650;
}
.calendar-summary strong {
  text-align: right;
  line-height: 1.3;
}
@media (max-width: 370px) {
  .calendar-screen > .detail-back,
  .calendar-screen > #calendar-results {
    margin-inline: 12px;
  }
  .calendar-week,
  .calendar-days {
    gap: 2px !important;
  }
  .calendar-day {
    height: 44px;
    min-height: 44px !important;
    border-radius: 7px !important;
  }
  .calendar-day .day-number {
    font-size: 13px;
  }
  .calendar-day .day-count {
    font-size: 9px;
  }
}

/* Week control: one invisible native select over a simple icon-and-label trigger. */
.calendar-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 44px;
  margin-top: 6px;
}
.calendar-footer .calendar-week-select-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  min-width: 0;
  min-height: 44px;
  margin: 0 !important;
  padding: 0 4px;
}
.calendar-week-select-wrap > svg:first-child {
  width: 19px;
  height: 19px;
  flex: none;
  stroke: #596168;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.calendar-week-select-wrap .calendar-week-label {
  position: static !important;
  display: block !important;
  width: auto !important;
  height: auto !important;
  overflow: visible !important;
  clip: auto !important;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 500;
  color: #30353a;
  pointer-events: none;
}
.calendar-footer .calendar-week-select-wrap select {
  position: absolute !important;
  inset: 0 !important;
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 44px !important;
  max-width: none !important;
  opacity: 0 !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  cursor: pointer;
  z-index: 1;
  margin: 0;
  padding: 0;
  border: 0;
}
.calendar-week-select-wrap .calendar-week-chevron {
  position: static !important;
  width: 15px !important;
  height: 15px !important;
  flex: none;
  stroke: #596168;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.calendar-footer .calendar-bottom {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex: 1;
  min-width: 0;
  min-height: 44px;
  margin: 0 !important;
  padding: 0 !important;
}
.calendar-footer .calendar-selection {
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.calendar-footer .calendar-clear {
  min-height: 40px;
  padding: 6px;
  white-space: nowrap;
}
@media (max-width: 370px) {
  .calendar-footer {
    gap: 4px;
  }
  .calendar-footer .calendar-week-select-wrap {
    gap: 5px;
  }
  .calendar-footer .calendar-bottom {
    gap: 3px;
  }
}

/* Calendar search, result count and work-day states. */
.calendar-object-search {
  margin-bottom: 8px;
}
.calendar-object-label {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.calendar-object-input {
  border-radius: 10px;
}
.calendar-object-input input {
  min-height: 40px !important;
  height: 40px;
  padding-inline: 12px;
  font-size: 14px;
}
.calendar-object-input button {
  min-height: 40px !important;
  height: 40px;
}
.calendar-day.has-work:not(.selected) {
  background: #f3f5f6 !important;
}
.calendar-day.has-work:not(.selected) .day-number {
  font-weight: 600;
  color: #303942;
}
.calendar-day.has-work:not(.selected) .day-count {
  color: #58636c;
}
.calendar-summary {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 6px;
  align-items: center !important;
}
.calendar-summary h2 {
  min-width: 0;
  font-size: 14px;
  white-space: nowrap;
}
.calendar-summary strong {
  min-width: 0;
  max-width: 100%;
  font-size: 11px;
  font-weight: 400;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
  color: #727981;
  letter-spacing: -0.01em;
}
.calendar-screen .calendar-footer {
  flex-wrap: nowrap;
}
.calendar-screen .calendar-footer .calendar-bottom {
  min-width: 0;
}
.calendar-screen .calendar-footer .calendar-selection {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.calendar-screen button,
.calendar-screen select,
.calendar-screen summary,
.calendar-screen .calendar-week-select-wrap {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}
.calendar-screen button,
.calendar-screen summary,
.calendar-screen .calendar-week-select-wrap {
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}
.calendar-screen button:focus:not(:focus-visible),
.calendar-screen summary:focus:not(:focus-visible) {
  outline: none;
}
@media (max-width: 370px) {
  .calendar-summary h2 {
    font-size: 13px;
  }
  .calendar-summary strong {
    font-size: 10px;
  }
  .calendar-summary {
    gap: 4px;
  }
}

/* Global mobile interaction policy: no native blue tap flash or accidental text selection.
   Keep text, input, textarea, and contenteditable selection intact. */
html,
body {
  -webkit-tap-highlight-color: transparent;
}
button,
[role="button"],
a,
summary,
select,
input[type="button"],
input[type="submit"],
input[type="reset"],
input[type="checkbox"],
input[type="radio"],
label[for],
.topbtn,
.calendar-week-select-wrap {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}
button,
[role="button"],
summary,
select,
input[type="button"],
input[type="submit"],
input[type="reset"],
.topbtn,
.calendar-week-select-wrap {
  -webkit-user-select: none;
  user-select: none;
}
button::selection,
summary::selection,
[role="button"]::selection,
.topbtn::selection {
  background: transparent;
  color: inherit;
}
button:focus:not(:focus-visible),
[role="button"]:focus:not(:focus-visible),
summary:focus:not(:focus-visible),
select:focus:not(:focus-visible) {
  outline: none;
}
button:focus-visible,
[role="button"]:focus-visible,
a:focus-visible,
summary:focus-visible,
select:focus-visible {
  outline: 2px solid #536375;
  outline-offset: 2px;
}
input:not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="checkbox"]):not(
    [type="radio"]
  ),
textarea,
[contenteditable="true"],
.editor {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

/* Vecka is a frameless native picker, including all focus states. */
.calendar-week-select-wrap,
.calendar-week-select-wrap:focus,
.calendar-week-select-wrap:focus-within,
.calendar-week-select-wrap select,
.calendar-week-select-wrap select:focus,
.calendar-week-select-wrap select:focus-visible {
  outline: none !important;
  box-shadow: none !important;
  border: 0 !important;
}

/* Android / coarse touch: suppress browser focus rings and blue touch flashes
   on every action control. Keep normal control borders, selection states and
   keyboard focus for fine-pointer / keyboard users. */
@media (pointer: coarse) {
  button,
  button:focus,
  button:focus-visible,
  a,
  a:focus,
  a:focus-visible,
  summary,
  summary:focus,
  summary:focus-visible,
  select,
  select:focus,
  select:focus-visible,
  [role="button"],
  [role="button"]:focus,
  [role="button"]:focus-visible,
  input[type="button"],
  input[type="submit"],
  input[type="reset"],
  input[type="checkbox"],
  input[type="radio"],
  .calendar-week-select-wrap,
  .calendar-week-select-wrap:focus-within {
    -webkit-tap-highlight-color: transparent !important;
    outline: none !important;
    outline-offset: 0 !important;
    box-shadow: none !important;
  }
  button,
  summary,
  [role="button"],
  select {
    -webkit-touch-callout: none;
  }
}

/* Container inputs use the container border only. */
.search input,
.calendar-object-input input {
  appearance: none;
  -webkit-appearance: none;
}
.calendar-object-input input:focus,
.calendar-object-input input:focus-visible {
  outline: 0;
  box-shadow: none;
}
/* Compact mobile note detail — one source of truth for note spacing. */
.detail #pane-note .editor {
  height: auto;
  min-height: 48px;
  max-height: none;
  resize: none;
  overflow-y: hidden;
  margin: 0;
  padding: 6px 0;
  font-size: 16px;
  line-height: 1.55;
}
.detail #pane-note .note-save-bar {
  min-height: 0;
  margin: 0 0 3px;
  gap: 8px;
}
.detail #pane-note .note-save-bar:has(#save-edits[hidden]) #note-save-status:empty {
  display: none;
}
.detail #pane-note .attach-tools {
  margin: 0 0 4px;
}
.detail #pane-note .quick-work {
  margin: 8px 0 0;
  padding-top: 10px;
}
.detail #pane-note .quick-work:not(.has-work) {
  border-top: 0;
  padding-top: 0;
  margin-top: 4px;
}
.detail #pane-note .quick-head h2 {
  font-size: 14px;
}
.detail #pane-note .compact-summary {
  margin: 7px 0;
  padding: 9px 11px;
  align-items: flex-start;
  gap: 8px;
  border-radius: 10px;
}
.detail #pane-note .compact-line {
  font-size: 13px;
  line-height: 1.4;
  padding: 3px 0;
}
.detail #pane-note .compact-summary strong {
  font-size: 16px;
}
.detail #pane-note .quick-actions {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 6px;
}
.detail #pane-note .quick-actions #quick-advanced,
.detail #pane-note .quick-actions #quick-open-pdf {
  align-self: auto;
  min-height: 44px;
  margin: 0;
  padding: 8px 12px;
  font-size: 13px;
  border-radius: 9px;
}
.detail #pane-note .quick-actions #quick-advanced {
  background: #f5f5f5;
  color: #333;
  border: 1px solid #e8e8e8;
  text-decoration: none;
}
.detail #pane-note .quick-actions #quick-open-pdf {
  background: #242424;
  color: #fff;
  border: 1px solid #242424;
}
.detail #pane-note .quick-work:not(.has-work) .quick-actions #quick-advanced {
  background: transparent;
  border: 0;
  color: #777;
  text-decoration: underline;
}
.detail #pane-note .attachment-list:empty {
  display: none;
}
.detail #pane-note .quick-work[hidden] {
  display: none !important;
}
@media (max-width: 440px) {
  .detail #pane-note .editor {
    min-height: 48px;
    height: auto;
  }
  .detail #pane-note .quick-work {
    margin-top: 8px;
  }
}

/* Long work descriptions wrap visibly without changing stored text or PDF limits. */
.work-card textarea.work-expanding-field {
  display: block;
  min-height: 44px;
  height: auto;
  resize: none;
  overflow: hidden;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Compact inline guidance for the existing PDF description constraints. */
.work-card .fieldrow:has(.work-description-hint) {
  align-items: start;
}
.work-card .work-description-hint {
  grid-column: 2;
  display: block;
  margin-top: -5px;
  font-size: 11px;
  line-height: 1.4;
  color: #66717b;
}
.work-card .work-description-hint.limit-reached {
  color: #9b6236;
}

/* Honor the note search visibility set by the notes controller. */
.search[hidden] {
  display: none !important;
}

/* One shared grid for the note title, age, preview and menu action.
   No independent absolute offsets for the two right-hand elements. */
.note {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  column-gap: 10px;
  align-items: center;
  padding: 13px 14px;
}
.note .note-title {
  grid-column: 1;
  grid-row: 1;
  max-width: none;
  min-width: 0;
}
.note .note-date {
  position: static;
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  white-space: nowrap;
  text-align: right;
  font-size: 12px;
  line-height: 1.45;
}
.note .note-preview {
  grid-column: 1;
  grid-row: 2;
  min-width: 0;
}
.note .dots {
  position: static;
  grid-column: 2;
  grid-row: 2;
  justify-self: end;
  align-self: center;
  display: grid;
  place-items: center;
  margin: -8px -9px -8px 0;
}
.note .menu {
  right: 12px;
  top: calc(100% - 8px);
}

/* New note: one fixed-size action beside the notebook title. */
.heading-row .new-note-btn {
  position: static;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 11px;
  background: #242424;
  color: #fff;
  border-color: #242424;
  box-shadow: none;
}
.heading-row .new-note-btn svg {
  width: 22px;
  height: 22px;
}
.heading-row .new-note-btn:active {
  background: #111;
  border-color: #111;
}
.heading-row .new-note-btn:focus-visible {
  outline: 2px solid #242424;
  outline-offset: 3px;
}

/* Shared two-column header layout: company identity and equal touch targets. */
.top {
  height: auto;
  min-height: 76px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 8px;
  padding-block: 12px;
}
.top .brand {
  min-width: 0;
  overflow: hidden;
  gap: 4px;
}
.top .brand-company {
  font-size: 19px;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.top .brand-worker {
  font-size: 13px;
  line-height: 1.3;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.top .actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}
.top .topbtn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 0;
  border-radius: 10px;
  background: transparent;
}
.top .topbtn svg {
  width: 20px;
  height: 20px;
  flex: none;
}
.top .topbtn .count {
  font-size: 10px;
  padding: 1px 4px;
  border-radius: 5px;
  background: transparent;
}
@media (max-width: 370px) {
  .top .brand-company {
    font-size: 17px;
  }
  .top .brand-worker {
    font-size: 12px;
  }
  .top .actions {
    gap: 2px;
  }
}

/* Creation toolbar: save and back share the same persisted workflow. */
.create-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.create-toolbar .detail-back {
  margin: 0;
}
.create-toolbar #save-note {
  min-height: 44px;
  padding: 10px 20px;
  border-radius: 10px;
}

/* Report status is part of the existing note card grid, not a second card. */
.note .note-report-bar {
  grid-column: 1/-1;
  grid-row: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid #edf0f1;
}
.note .note-report-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #68717a;
  min-width: 0;
  min-height: 36px;
  padding: 5px 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.note .note-report-status svg {
  width: 15px;
  height: 15px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.note .note-report-status.is-ready {
  color: #242424;
}
.note .note-report-action {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  color: #242424;
  background: transparent;
  border: 0;
  padding: 7px 0 7px 10px;
  min-height: 36px;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.note .note-report-action:focus-visible {
  outline: 2px solid #555;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Notebook heading must accommodate long names on narrow screens. */
.heading-row h1 {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* Note PDF action container and visibility; visual rules are shared below. */
#pdf-actions {
  justify-content: stretch;
}
#pdf-actions[hidden],
#pdf-actions button[hidden] {
  display: none !important;
}

/* Calendar stays primary; search expands only on demand. */
.calendar-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.calendar-heading-row .calendar-heading {
  margin: 0;
}
#calendar-search-toggle {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #242424;
  cursor: pointer;
}
#calendar-search-toggle[aria-expanded="true"] {
  background: #eceeef;
}
#calendar-search-toggle svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#calendar-search-toggle[aria-expanded="false"] .search-close-icon,
#calendar-search-toggle[aria-expanded="true"] .search-open-icon,
.calendar-object-search[hidden] {
  display: none !important;
}

/* Shared compact action row for calendar and both PDF previews. */
#pdf-actions,
.calendar-report-actions,
.preview-report-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: stretch;
}
#pdf-actions > button,
.calendar-report-actions > button,
.calendar-report-actions > button:first-child,
.preview-report-actions > button {
  flex: 1 1 0;
  min-width: 0;
  height: 44px;
  min-height: 44px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 4px !important;
  color: #242424;
  font-size: 12px !important;
  line-height: 1.3;
  background: #fff;
  border: 1px solid #dedede;
  border-radius: 10px;
  white-space: nowrap;
}
#pdf-actions > button svg,
.calendar-report-actions > button svg,
.preview-report-actions > button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.calendar-grouping-actions svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
#pdf-actions > button[hidden],
.preview-report-actions > button[hidden] {
  display: none !important;
}
@media (max-width: 360px) {
  #pdf-actions,
  .calendar-report-actions,
  .preview-report-actions {
    gap: 5px;
  }
  #pdf-actions > button,
  .calendar-report-actions > button,
  .preview-report-actions > button {
    font-size: 11px !important;
    gap: 3px;
  }
  #pdf-actions > button svg,
  .calendar-report-actions > button svg,
  .preview-report-actions > button svg {
    width: 15px;
    height: 15px;
  }
}
.pdf-report-select {
  display: block;
  width: 100%;
  min-height: 44px;
  margin: 0 0 10px;
  padding: 6px 8px;
  border: 1px solid #dedede;
  border-radius: 9px;
  background: #fff;
  color: #242424;
  font-size: 13px;
}
.calendar-grouping-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.calendar-grouping-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 6px 10px;
  border: 0;
  background: transparent;
  color: #242424;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.calendar-grouping-actions svg {
  width: 17px;
  height: 17px;
}

/* Single in-flow PDF screen, shared by notes and calendar. */
.app > .pdf-preview-overlay {
  position: static;
  inset: auto;
  display: block;
  max-height: none;
  padding: 16px 16px 48px;
  background: transparent;
  overscroll-behavior: auto;
  z-index: auto;
}
.app > .pdf-preview-overlay[hidden] {
  display: none !important;
}
.app .pdf-preview-panel {
  display: block;
  width: 100%;
  max-width: none;
  height: auto;
  max-height: none;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}
.app .pdf-preview-header {
  display: block;
  padding: 0;
  background: transparent;
  border: 0;
}
.app .pdf-preview-header #pdf-preview-close {
  display: inline-flex;
  min-height: 44px;
  padding: 0 3px;
  margin: 0 0 12px;
  border: 0;
  background: transparent;
  font: inherit;
}
.app .pdf-preview-header h1 {
  font-size: 21px;
  margin: 0 0 14px;
}
.app #pdf-preview-visual {
  padding: 0;
  background: transparent;
  overflow: visible;
  max-height: none;
  text-align: left;
}
.app .pdf-preview-page {
  width: 100%;
  max-width: none;
  margin: 0 0 14px;
  border: 1px solid #e7e7e7;
}
.app .preview-report-actions {
  max-width: none;
  margin: 0;
  padding: 0;
}
.app .pdf-row-picker {
  margin-top: 12px;
  padding: 12px 0;
  background: transparent;
}
.pdf-issue-warning {
  border: 1px solid #e7e0d5;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
  background: #faf8f4;
  color: #493d2e;
  font-size: 13px;
}
.pdf-issue-warning .report-hint {
  margin: 6px 0 0;
  line-height: 1.5;
}

/* Zoom only the PDF document; action controls remain at normal scale. */
.app .pdf-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.app .pdf-title-row h1 {
  margin: 0;
}
.app #pdf-zoom-toggle {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #242424;
}
#pdf-zoom-toggle[hidden],
#pdf-zoom-toggle[aria-pressed="true"] .pdf-zoom-plus {
  display: none !important;
}
#pdf-zoom-toggle svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}
.pdf-document-viewport {
  width: 100%;
  overflow: auto;
  touch-action: pan-x pan-y;
  overscroll-behavior: contain;
  margin-bottom: 14px;
}
.pdf-document-viewport.is-zoomed {
  max-height: 65dvh;
  cursor: grab;
}
.pdf-document-viewport.is-zoomed:active {
  cursor: grabbing;
}
.pdf-document-sheet {
  width: 100%;
  min-width: 100%;
}
.app .pdf-document-sheet .pdf-preview-page {
  display: block;
  width: 100%;
  max-width: none;
  height: auto;
  margin: 0 0 12px;
}
.app .pdf-document-sheet .pdf-preview-page:last-child {
  margin-bottom: 0;
}

#worker-switch {font:inherit;color:inherit;background:transparent;border:0;padding:0;text-align:left;cursor:pointer}
.worker-view {box-sizing:border-box;width:min(100%,40rem);max-height:90dvh;border:1px solid #d4d7da;border-radius:1rem;padding:1rem;color:#202428;background:white;overflow:auto}
.worker-view::backdrop {background:#1118}
.worker-view header,.worker-view nav {display:flex;flex-wrap:wrap;align-items:center;gap:.6rem;margin-bottom:.8rem}
.worker-view header strong {flex:1;overflow-wrap:anywhere}
.worker-view button,.worker-view input {font:inherit;min-height:44px;border:1px solid #ced1d4;border-radius:.5rem;padding:.45rem .7rem;background:#fff;color:inherit}
.worker-view article {border-top:1px solid #ddd;padding:.75rem 0}
.worker-view pre {white-space:pre-wrap;overflow-wrap:anywhere;font:inherit}
.worker-view canvas {width:100%;height:auto;border:1px solid #ddd}
.worker-view textarea {width:100%;box-sizing:border-box}
.worker-view small {display:block;color:#505961}
.worker-view.worker-full {position:fixed;inset:0;margin:0;width:100%;height:100dvh;max-width:none;max-height:100dvh;border:0;border-radius:0;padding: max(1rem,env(safe-area-inset-top)) max(1rem,calc((100vw - 44rem)/2)) max(2rem,env(safe-area-inset-bottom));background:#fcfcfb}
.worker-view header {justify-content:space-between}
.worker-full header button:first-child {border:0;background:transparent;font-size:1.35rem;font-weight:700;padding-inline:0}
.worker-view:not(.worker-full)>button {display:block;width:100%;text-align:left;margin-block:.35rem}
.worker-view nav {margin-top:.7rem}
.worker-view nav button[aria-pressed=true] {background:#242424;color:#fff}
.worker-view .worker-note {display:block;width:100%;text-align:left;border-radius:.85rem;padding:.8rem 1rem;margin-block:.5rem;overflow-wrap:anywhere}
.worker-note span {display:block;color:#515a65;margin-top:.3rem}
.worker-full .datehead {margin:1rem 0 .35rem}
.worker-connections {margin-top:1rem;border-top:1px solid #ddd}
.worker-connections summary {cursor:pointer;padding:.9rem 0;color:#515a65}
.worker-connections article {display:flex;align-items:center;justify-content:space-between;gap:.6rem;overflow-wrap:anywhere}

.worker-view.worker-full:has(iframe){padding:0;overflow:hidden}
.worker-view iframe{display:block;width:100%;height:100%;border:0}
.shared-worker-updated{display:block;font:400 .75rem system-ui;color:#59636c}
.reading-worker :is(#new-note-btn,.dots,.menu,#save-edits,#add-work-row,#confirm-work,.remove-row,#detail-attach,#detail-files,#pdf-row-edit,#pdf-preview-edit,[aria-label="Redigera arbetsuppgifter"],[data-action="Inställningar"],#edit-work-from-pdf){display:none!important}
.worker-qr {display:block;width:min(100%,19rem);height:auto;margin:auto;image-rendering:pixelated}
.worker-view article:has(>button) {display:flex;align-items:center;justify-content:space-between;gap:.6rem;overflow-wrap:anywhere}

/* Main notebook: one card per original note, with existing report actions. */
#groups .note {grid-template-columns:minmax(0,1fr) auto;grid-template-rows:auto auto;gap:4px 10px;align-items:start}
#groups .note .card-icon {display:none}
#groups .note .note-title {grid-column:1;grid-row:1;white-space:normal;overflow-wrap:anywhere;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}
#groups .note .note-preview {grid-column:1/-1;grid-row:2;-webkit-line-clamp:1;margin:0}
#groups .note .dots {grid-column:2;grid-row:1;align-self:center;margin:0;min-width:32px;min-height:28px}
#groups .card-report {grid-template-columns:minmax(0,1fr) auto auto}
#groups .card-report .card-hours {grid-column:2;grid-row:1;font-size:16px;white-space:nowrap;align-self:center}
#groups .card-report .dots {grid-column:3}
#groups .note .note-report-bar {grid-row:2;margin-top:5px;padding-top:5px;gap:8px;min-height:40px}
#groups .note .note-report-action,#groups .note .note-report-status {font-size:13px;min-height:40px;text-decoration:none}
#groups .note .note-report-action {margin-left:auto}
#groups .card-review-action {grid-column:1/-1;grid-row:2;min-height:36px;border:0;background:transparent;color:#565d62;text-align:left;padding:4px 0;font:inherit;font-size:13px;text-decoration:underline;text-underline-offset:3px}
#groups .card-icon svg {width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linejoin:round;stroke-linecap:round}

/* Report information above, actions below. */
#groups .card-report {grid-template-columns:minmax(0,1fr) auto;grid-template-rows:auto auto;padding:12px 14px 7px;gap:8px 10px;align-items:center}
#groups .card-report .note-title {grid-column:1;grid-row:1;align-self:center}
#groups .card-report .card-hours {grid-column:2;grid-row:1;justify-self:end;align-self:center}
#groups .card-report .note-report-bar {grid-column:1/-1;grid-row:2;margin:0;padding:4px 0 0;min-height:44px;align-items:center}
#groups .card-report:has(>.dots) .note-report-bar {padding-right:44px}
#groups .card-report .dots {grid-column:2;grid-row:2;justify-self:end;align-self:center;width:40px;height:44px;z-index:1;margin-top:4px}
#groups .card-report .note-report-action {font-weight:600;color:#242424}
#groups .card-report .card-edit {color:#656b70}
/* Compact cards retain the approved 87077db footprint. */
#groups .card-report:has(>.dots) .note-report-bar {padding-right:60px}
#groups .note > .dots {width:32px;height:28px;line-height:1;letter-spacing:1px}
#groups .card-actions-open > :not(.card-icon):not(.dots):not(.card-action-panel) {visibility:hidden;pointer-events:none}
#groups .card-actions-open > .dots {z-index:2;font-size:24px;letter-spacing:0;color:#565d62}
#groups .card-action-panel {position:absolute;inset:8px 48px 8px 12px;display:flex;align-items:center;justify-content:center;gap:12px;color:#242424;min-width:0}
#groups .card-action-panel button {display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:40px;padding:4px 8px;border:0;background:transparent;color:inherit;font:inherit;font-size:13px;cursor:pointer}
#groups .card-action-panel button svg {width:18px;height:18px;flex:none;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
#groups .card-report .card-action-panel {inset:8px 52px 8px 12px}
.card-dialog-form {display:grid;gap:10px}
.card-dialog-form input {box-sizing:border-box;width:100%;min-width:0;min-height:44px;padding:8px 10px;border:1px solid #cbd0d4;border-radius:6px;background:white;color:#242424;font:inherit;font-size:16px}
.card-dialog-form .card-action-buttons {display:flex;justify-content:flex-end;gap:10px}
.card-dialog-form .card-action-buttons button {width:auto;min-height:44px;padding:8px 14px;margin:0}
.card-dialog-form .card-action-buttons button:first-child {background:transparent;color:#565d62;border:1px solid #d8d8d8}
.card-dialog-form .card-action-error {color:#656b70;font-size:12px}
.card-dialog-form .card-action-error:empty {display:none}
#modal [hidden] {display:none!important}

/* Ready reports: the PDF preview is the sole entry to report actions. */
#groups .card-report .note-report-action {display:flex;align-items:center;gap:5px;margin:0;padding:5px 0;min-height:40px;color:#656b70;font-size:13px;font-weight:400;text-align:left}
#groups .card-report .card-pdf-icon {display:inline-flex;flex:none}
#groups .card-report .note-report-action svg {width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
#groups .card-report .card-pdf-chevron {display:none}
