/* 桌機善用寬度，手機改以可點按、可閱讀的週列表呈現。 */
body {
  font-size: 15px;
}
main {
  width: 100%;
  max-width: none;
  padding: 22px clamp(18px, 2vw, 42px) 0;
}
.topbar {
  padding: 0 clamp(18px, 2vw, 42px);
}
.b {
  font-size: 14px;
  min-height: 40px;
  padding: 8px 14px;
}
.calendar-panel#mainc {
  padding: 23px clamp(16px, 1.6vw, 28px) 0;
}
.calendar-top h2 {
  font-size: 27px;
}
.calendar-top .eyebrow {
  font-size: 12px;
}
.calendar-actions .b {
  font-size: 14px;
  min-height: 42px;
  padding: 8px 15px;
}
.nav select {
  font-size: 14px;
  min-height: 40px;
  padding: 8px;
}
.nav .arrow {
  width: 40px;
  height: 40px;
}
.nav .today-btn {
  font-size: 13px;
  min-height: 40px;
  padding: 7px 13px;
}
.filter button {
  font-size: 13px;
  padding: 7px 15px;
  min-height: 36px;
}
.assignment-modes .b {
  font-size: 14px;
  min-height: 40px;
  padding: 7px 16px;
}
.tool-label,
.tool-month,
.person-group-label {
  font-size: 12px;
}
.desktop-persons {
  gap: 12px 24px;
}
.person-chip.b {
  font-size: 14px;
  min-height: 42px;
  padding: 8px 14px;
}
.person-chip.b small {
  font-size: 12px;
}
.assignment-status {
  font-size: 13px;
  min-height: 24px;
}
.grid {
  gap: 7px;
}
.wk {
  font-size: 13px;
  padding: 9px 0;
}
.d {
  min-height: clamp(110px, 11vh, 150px);
  padding: 9px;
}
.d em {
  font-size: 15px;
}
.d .c {
  font-size: 14px;
  min-height: 30px;
  padding: 5px 6px;
}
.d .c.n::after,
.d .c.h::after {
  font-size: 11px;
}
.d.today em::after {
  font-size: 11px;
}
.empty-day {
  font-size: 12px;
}
.d.cl .c {
  font-size: 13px;
}
.legend {
  font-size: 12px;
}
.footer-tip {
  font-size: 12px;
}
.support-section > summary {
  padding: 18px 22px;
  min-height: 66px;
}
.support-section > summary b {
  font-size: 16px;
}
.support-section > summary small,
.summary-hint {
  font-size: 12px;
}
.metric-title {
  font-size: 13px;
}
.metric-note {
  font-size: 11px;
  white-space: normal;
}
.metric-value {
  font-size: 28px;
}
.metric-value small {
  font-size: 12px;
}
.support-section .stat-summary {
  font-size: 12px;
}
.stat-legend {
  font-size: 12px;
}
.phone-view-switch,
.phone-week-nav,
#phone-week {
  display: none;
}
.phone-view-switch button {
  border: 0;
  background: transparent;
  cursor: pointer;
  color: #748868;
  border-radius: 6px;
  font: inherit;
  padding: 7px 16px;
  min-height: 40px;
}
.phone-view-switch button.active {
  background: #fff;
  color: #2c5a3f;
  box-shadow: 0 1px 4px #243b3314;
  font-weight: 600;
}
#cal .d {
  scroll-margin-top: 200px;
}

@media (min-width: 768px) and (max-width: 1100px) {
  main {
    padding: 18px 18px 0;
  }
  .calendar-panel#mainc {
    padding: 18px 15px 0;
  }
  .calendar-top {
    flex-wrap: wrap;
  }
  .calendar-actions {
    flex-wrap: wrap;
  }
  .desktop-persons {
    gap: 12px;
  }
  .d {
    padding: 7px 5px;
  }
  .d .c {
    font-size: 13px;
  }
  .d .c.n::after,
  .d .c.h::after {
    display: none;
  }
  .overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* 窄視窗與手機觸控橫向共用適配，避免以裝置名稱硬判斷。 */
.phone-layout body {
  font-size: 15px;
}
.phone-layout main {
  display: block;
  padding: 12px 10px 0;
}
.phone-layout .topbar {
  height: auto;
  min-height: 68px;
  padding: 10px 13px;
  gap: 9px;
}
.phone-layout .compact-brand img {
  width: 34px;
  height: 34px;
}
.phone-layout .compact-brand > span {
  font-size: 20px;
}
.phone-layout .compact-brand small {
  display: none;
}
.phone-layout .account {
  width: auto;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.phone-layout #cm,
.phone-layout .account-divider {
  display: none;
}
.phone-layout .account #who {
  font-size: 12px;
  max-width: 85px;
}
.phone-layout .account .b {
  min-height: 38px;
  font-size: 12px;
  padding: 7px 10px;
}
.phone-layout .account #cpw {
  font-size: 11px;
}
.phone-layout .calendar-panel#mainc {
  padding: 16px 10px 0;
}
.phone-layout .calendar-top {
  display: block;
  padding: 0 2px;
}
.phone-layout .calendar-top .eyebrow {
  display: none;
}
.phone-layout .calendar-top h2 {
  font-size: 24px;
  margin: 0 0 12px;
}
.phone-layout .calendar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  width: 100%;
}
.phone-layout .calendar-actions .b {
  flex: 1;
  min-height: 42px;
  font-size: 13px;
  padding: 8px 10px;
  white-space: nowrap;
}
.phone-layout .calendar-actions .pill {
  display: none;
}
.phone-layout .calendar-actions .export-btn svg {
  display: none;
}
.phone-layout .nav {
  margin: 13px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.phone-layout .month-controls {
  gap: 5px;
  display: flex;
  justify-content: space-between;
  width: 100%;
}
.phone-layout .nav select {
  font-size: 14px;
  min-height: 42px;
  padding: 7px 6px;
  flex: 1;
  min-width: 0;
}
.phone-layout .nav .arrow {
  height: 42px;
  width: 40px;
  flex: none;
}
.phone-layout .nav .today-btn {
  min-height: 42px;
  font-size: 13px;
  padding: 7px 12px;
  flex: none;
}
.phone-layout .filter {
  width: 100%;
  display: flex;
  padding: 3px;
}
.phone-layout .filter button {
  flex: 1;
  font-size: 13px;
  min-height: 38px;
  padding: 7px;
}
.phone-layout #pal.assignment-toolbar {
  top: 0;
  padding: 10px;
  margin: 0 0 13px;
  border-radius: 8px;
}
.phone-layout .tool-mode-row {
  gap: 4px;
}
.phone-layout .tool-label,
.phone-layout .tool-month {
  display: none;
}
.phone-layout .assignment-modes {
  display: flex;
  gap: 4px;
  flex: 1;
}
.phone-layout .assignment-modes .b {
  flex: 1;
  min-width: 0;
  min-height: 42px;
  padding: 7px 4px;
  font-size: 12px;
  white-space: nowrap;
}
.phone-layout .desktop-persons {
  display: none;
}
.phone-layout .mobile-persons {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  margin-top: 9px;
}
.phone-layout .mobile-persons select {
  min-height: 44px;
  font-size: 15px;
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 8px;
}
.phone-layout .assignment-status {
  font-size: 12px;
  line-height: 1.7;
  margin-top: 6px;
  min-height: 21px;
}
.phone-layout .guest-toolbar {
  display: flex;
  gap: 9px;
  align-items: center;
}
.phone-layout .guest-toolbar-copy {
  display: block;
  font-size: 12px;
}
.phone-layout .guest-toolbar-copy b {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
}
.phone-layout .guest-toolbar-copy span {
  font-size: 12px;
}
.phone-layout .guest-toolbar .b {
  font-size: 13px;
  min-height: 42px;
  white-space: nowrap;
}
.phone-layout .member-toolbar .b {
  min-height: 42px;
  font-size: 14px !important;
}
.phone-layout .member-toolbar .mu {
  font-size: 12px !important;
}
.phone-layout .phone-view-switch {
  display: flex;
  padding: 3px;
  border-radius: 8px;
  background: #eff3e9;
  margin: 0 0 12px;
}
.phone-layout .phone-view-switch button {
  flex: 1;
  font-size: 14px;
}
.phone-week-view #cal {
  display: none;
}
.phone-week-view #phone-week {
  display: grid;
  gap: 9px;
}
.phone-week-view .phone-week-nav {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.phone-week-nav .b {
  width: 44px;
  min-height: 44px;
  padding: 4px;
  font-size: 23px;
}
.phone-week-nav > div {
  text-align: center;
}
.phone-week-nav strong {
  display: block;
  font-size: 16px;
  color: #49633d;
}
.phone-week-nav small {
  font-size: 11px;
  color: #91a180;
}
.phone-week-view .week-day.d {
  display: grid;
  grid-template-columns: 59px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  text-align: left;
  padding: 12px;
  min-height: 95px;
  border-radius: 8px;
  scroll-margin-top: 180px;
}
.phone-week-view .week-date {
  margin: 0;
  padding: 0;
  text-align: center;
  line-height: 1.3;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.phone-week-view .week-date::after {
  display: none !important;
}
.phone-week-view .week-date > span {
  font-size: 12px;
  color: #89967d;
}
.phone-week-view .week-date strong {
  font-size: 26px;
  line-height: 1.2;
  color: #46623b;
  font-weight: 600;
}
.phone-week-view .week-date small {
  font-size: 11px;
  color: #9ba68c;
}
.phone-week-view .week-people {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  align-items: center;
  min-width: 0;
}
.phone-week-view .week-people .c {
  font-size: 15px;
  min-height: 36px;
  padding: 6px 9px;
  line-height: 1.6;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}
.phone-week-view .week-people .c.n::after {
  content: " · 監工";
  display: inline;
  font-size: 11px;
}
.phone-week-view .week-people .c.h::after {
  content: " · 工安";
  display: inline;
  font-size: 11px;
}
.phone-week-view .week-people .empty-day {
  font-size: 13px;
  line-height: 1.8;
  color: #a0ac95;
}
.phone-week-view .week-day.cl {
  min-height: 80px;
}
.phone-week-view .week-day.cl .c {
  font-size: 14px;
  color: #a9b19e;
}
.phone-layout .grid {
  gap: 4px;
}
.phone-layout .d {
  min-height: 92px;
  padding: 5px 2px;
}
.phone-layout .d em {
  font-size: 12px;
}
.phone-layout #cal .c {
  font-size: 12px;
  padding: 4px 1px;
  min-height: 25px;
}
.phone-layout #cal .c.n::after,
.phone-layout #cal .c.h::after {
  display: none;
}
.phone-layout #cal .empty-day {
  font-size: 10px;
}
.phone-layout .wk {
  font-size: 12px;
  padding: 7px 0;
}
.phone-layout .legend {
  font-size: 10px;
  gap: 11px;
}
.phone-layout .footer-tip {
  display: none;
}
.phone-layout .supporting-sections {
  display: grid;
  gap: 12px;
  margin-top: 15px;
}
.phone-layout .support-section > summary {
  padding: 16px 14px;
  min-height: 62px;
  gap: 7px;
}
.phone-layout .support-section > summary b {
  font-size: 15px;
}
.phone-layout .support-section > summary small {
  font-size: 11px;
}
.phone-layout .summary-hint {
  display: none;
}
.phone-layout .support-body,
.phone-layout #section-settings #cfg {
  padding: 15px 13px;
}
.phone-layout .overview {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}
.phone-layout .metric {
  padding: 13px 10px;
  gap: 9px;
  min-height: 105px;
}
.phone-layout .metric-icon {
  display: none;
}
.phone-layout .metric-title {
  font-size: 12px;
}
.phone-layout .metric-note {
  font-size: 10px;
  line-height: 1.7;
}
.phone-layout .metric-value {
  font-size: 27px;
}
.phone-layout #section-stats #st .sr {
  grid-template-columns: 67px minmax(30px, 1fr);
  gap: 5px 10px;
  margin-top: 22px;
}
.phone-layout #section-stats #st .sr > .c {
  font-size: 13px;
  grid-row: 1/3;
  align-self: center;
}
.phone-layout #section-stats #st .sr > span:last-child {
  font-size: 12px;
  grid-column: 2;
  white-space: normal;
}
.phone-layout #section-stats #st .bar {
  align-self: end;
  height: 7px;
}
.phone-layout #cfg .box {
  padding: 0;
}
.phone-layout #cfg .prow {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  padding: 14px 0;
}
.phone-layout #cfg .prow > .row {
  margin-left: auto;
  flex-wrap: wrap;
}
.phone-layout #cfg .nmt {
  font-size: 14px;
}
.phone-layout #cfg .b {
  font-size: 13px;
  min-height: 40px;
  padding: 7px 10px;
}
.phone-layout #cfg .mu {
  font-size: 12px;
}
.phone-layout #cfg input,
.phone-layout #cfg select {
  font-size: 15px;
  min-height: 44px;
}
.phone-layout #cfg .sw {
  width: 34px;
  height: 20px;
}
.phone-layout #cfg .sw i::after {
  width: 16px;
  height: 16px;
}
.phone-layout #cfg .sw input:checked + i::after {
  transform: translateX(14px);
}
.phone-layout #section-requests .mu {
  font-size: 13px;
}
.phone-layout #section-requests .b {
  min-height: 44px;
}
.phone-layout #pending-alert {
  font-size: 12px;
  gap: 8px;
}
.phone-layout #pending-alert .b {
  font-size: 12px;
  min-height: 40px;
}
.phone-layout .page-footer {
  font-size: 10px;
  line-height: 1.8;
}
.phone-layout #sheet .pn {
  padding: 22px 18px !important;
}
.phone-layout .pn .b {
  min-height: 44px;
  font-size: 14px;
}
.phone-layout .pn input,
.phone-layout .pn select {
  font-size: 16px;
  min-height: 44px;
}
.phone-layout .pn .mu {
  font-size: 13px;
}
@media print {
  #app {
    display: none !important;
  }
}

/* 手機合併重複的月份、篩選區，保留更多空間閱讀班次。 */
.phone-monthbar {
  display: none;
}
.phone-layout .phone-monthbar {
  display: flex;
  gap: 6px;
  align-items: center;
  margin: 0 0 11px;
}
.phone-layout .phone-monthbar > .b {
  min-height: 44px;
  font-size: 15px;
  padding: 6px 8px;
  flex: none;
}
.phone-layout .phone-monthbar > .phone-month-picker {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-size: 18px;
  white-space: nowrap;
  padding: 6px;
}
.phone-layout .phone-month-picker small {
  font-size: 13px;
  color: #96a18b;
}
.phone-layout .calendar-top > div:first-child,
.phone-layout #mainc > .nav {
  display: none;
}
.phone-layout .calendar-actions {
  margin-bottom: 12px;
}
.phone-layout .phone-view-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  align-items: center;
}
.phone-layout .phone-view-switch button {
  padding: 7px 5px;
  white-space: nowrap;
}

.phone-layout .phone-week-nav {
  margin-bottom: 10px;
}
.phone-layout .phone-week-nav small {
  display: none;
}
