:root {
  color-scheme: dark;
  --bg-main: #0b1016;
  --bg-side: #101821;
  --bg-panel: #141d27;
  --bg-card: #192433;
  --bg-card-2: #202b39;
  --line-soft: #2a3645;
  --line-strong: #3b4b60;
  --text-main: #e8edf2;
  --text-sub: #a8b3c2;
  --text-muted: #718093;
  --accent-jade: #4fd1b0;
  --accent-gold: #d6b36a;
  --accent-red: #b85c5c;
  --accent-blue: #6ba4d8;
  --accent-ink: #141312;
  --radius-card: 8px;
  --radius-button: 8px;
  --shadow-panel: 0 20px 60px rgba(0, 0, 0, 0.24);
  font-family:
    Pretendard,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg-main);
  scrollbar-gutter: stable;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-y: scroll;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.018) 0,
      rgba(255, 255, 255, 0.018) 1px,
      transparent 1px,
      transparent 48px
    ),
    var(--bg-main);
  color: var(--text-main);
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

input,
select {
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-button);
  background: #0e151d;
  color: var(--text-main);
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--accent-jade);
  box-shadow: 0 0 0 3px rgba(79, 209, 176, 0.12);
}

.boot {
  display: flex;
  align-items: center;
  gap: 14px;
  width: min(420px, calc(100vw - 32px));
  margin: 18vh auto 0;
  padding: 18px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-card);
  background: var(--bg-panel);
  box-shadow: var(--shadow-panel);
}

.boot__mark {
  display: grid;
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  align-content: center;
  justify-items: center;
  border: 1px solid rgba(214, 179, 106, 0.5);
  border-radius: 50%;
  color: var(--accent-gold);
  font-size: 12px;
  font-weight: 950;
  gap: 1px;
  line-height: 0.86;
  white-space: nowrap;
  text-shadow: 0 0 0 currentColor;
}

.boot__mark span {
  display: block;
}

.boot span {
  display: block;
  margin-top: 4px;
  color: var(--text-sub);
  font-size: 14px;
}

.app-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 14px;
  border-right: 1px solid var(--line-soft);
  background: rgba(16, 24, 33, 0.96);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 20px;
}

.brand__seal {
  display: grid;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  aspect-ratio: 1;
  grid-template-rows: repeat(2, auto);
  align-content: center;
  justify-items: center;
  border: 1px solid rgba(214, 179, 106, 0.58);
  border-radius: 50%;
  background: #15191b;
  color: var(--accent-gold);
  font-size: 10px;
  font-weight: 950;
  gap: 0;
  line-height: 0.82;
  white-space: nowrap;
  text-shadow: 0 0 0 currentColor;
}

.brand__seal span {
  display: block;
}

.brand strong {
  display: block;
  letter-spacing: 0;
}

.brand span {
  color: var(--text-muted);
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav__item,
.bottom-nav__item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-height: 42px;
  padding: 0 12px;
  border-radius: var(--radius-button);
  background: transparent;
  color: var(--text-sub);
  text-align: left;
}

.nav__item:hover,
.bottom-nav__item:hover {
  background: rgba(79, 209, 176, 0.08);
  color: var(--text-main);
}

.nav__item.is-active,
.bottom-nav__item.is-active {
  background: rgba(79, 209, 176, 0.13);
  color: var(--accent-jade);
}

.nav__glyph {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid var(--line-soft);
  border-radius: 50%;
  color: var(--accent-gold);
  font-size: 12px;
}

.main-area {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(11, 16, 22, 0.9);
  backdrop-filter: blur(16px);
}

.topbar__left,
.topbar__right {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.character-select {
  width: clamp(120px, 18vw, 168px);
  height: 38px;
  padding: 0 34px 0 12px;
  border-color: rgba(107, 164, 216, 0.34);
  background-color: rgba(14, 21, 29, 0.74);
  font-weight: 750;
  text-overflow: ellipsis;
}

.time-chip {
  display: grid;
  gap: 2px;
  min-height: 46px;
  padding: 6px 10px;
  border: 1px solid rgba(214, 179, 106, 0.42);
  border-radius: var(--radius-button);
  color: var(--accent-gold);
  white-space: nowrap;
}

.time-chip span {
  display: grid;
  grid-template-columns: 62px 72px;
  align-items: baseline;
  gap: 8px;
  color: var(--text-sub);
  font-size: 12px;
}

.time-chip em {
  color: var(--text-sub);
  font-style: normal;
}

.time-chip strong {
  color: var(--accent-gold);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.content {
  width: min(1220px, 100%);
  margin: 0 auto;
  padding: 28px 24px 42px;
}

.app-footer {
  width: min(1220px, 100%);
  margin: 0 auto;
  padding: 0 24px 28px;
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
}

.app-footer span {
  display: inline-block;
  max-width: 100%;
  line-height: 1.45;
  overflow-wrap: break-word;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.page-head > div {
  min-width: 0;
}

.page-head h1 {
  margin: 0;
  font-size: clamp(24px, 4vw, 34px);
  line-height: 1.15;
}

.page-head p {
  max-width: 100%;
  margin: 8px 0 0;
  color: var(--text-sub);
  font-size: 14px;
  line-height: 1.45;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: normal;
  white-space: nowrap;
  word-break: keep-all;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  max-width: 100%;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-button);
  background: var(--bg-card-2);
  color: var(--text-main);
  white-space: nowrap;
}

.btn:hover {
  border-color: var(--line-strong);
}

.btn--primary {
  background: var(--accent-jade);
  color: #06231d;
  font-weight: 700;
}

.btn--danger {
  background: rgba(184, 92, 92, 0.16);
  color: #ffb9b9;
}

.btn--ghost {
  border-color: var(--line-soft);
  background: transparent;
}

.btn--icon {
  width: 36px;
  padding: 0;
  font-size: 22px;
  line-height: 1;
}

.grid {
  display: grid;
  gap: 14px;
}

.grid--dashboard {
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  align-items: stretch;
}

.grid--dashboard > .panel {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.grid--dashboard > .panel > .task-list,
.grid--dashboard > .panel > .grid {
  flex: 1;
}

.grid--dashboard > .panel > .grid {
  align-content: start;
}

.grid--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel,
.task-card,
.resource-card,
.event-card,
.character-card {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-card);
  background: rgba(20, 29, 39, 0.88);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.16);
}

.panel {
  padding: 16px;
}

.panel__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.panel__head h2,
.panel__head h3 {
  margin: 0;
  font-size: 18px;
}

.panel__meta {
  color: var(--text-muted);
  font-size: 13px;
}

.progress {
  display: grid;
  gap: 8px;
}

.progress__top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-sub);
}

.progress__bar {
  overflow: hidden;
  height: 11px;
  border-radius: 999px;
  background: #0e151d;
}

.progress__fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-jade), var(--accent-gold));
}

.task-list {
  display: grid;
  gap: 10px;
}

.custom-task-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto;
  gap: 8px;
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-card);
  background: rgba(20, 29, 39, 0.66);
}

.custom-task-form input {
  height: 38px;
  padding: 0 10px;
}

.task-section {
  display: grid;
  gap: 10px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 8px;
}

.section-title h2 {
  margin: 0;
  font-size: 18px;
}

.task-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 74px;
  padding: 13px 14px;
}

.task-card.is-done {
  border-color: rgba(79, 209, 176, 0.45);
  background: rgba(27, 55, 51, 0.5);
}

.task-card.is-info {
  border-color: rgba(107, 164, 216, 0.3);
  background: rgba(21, 36, 49, 0.62);
}

.task-card__main {
  min-width: 0;
}

.task-card__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}

.task-card__title strong {
  overflow-wrap: break-word;
  word-break: keep-all;
}

.task-card__meta {
  color: var(--text-muted);
  font-size: 13px;
}

.task-card__tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  min-height: 22px;
  padding: 0 8px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  overflow-wrap: break-word;
  word-break: keep-all;
}

.task-card__side {
  display: grid;
  gap: 8px;
  justify-items: end;
  min-width: 136px;
}

.task-card.is-info .task-card__side {
  min-width: auto;
}

.task-card__desc {
  margin-top: 5px;
  color: var(--text-sub);
  font-size: 12px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: clip;
  overflow-wrap: normal;
  white-space: nowrap;
  word-break: keep-all;
}

.priority {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.priority--S {
  background: rgba(214, 179, 106, 0.16);
  color: var(--accent-gold);
}

.priority--A {
  background: rgba(79, 209, 176, 0.14);
  color: var(--accent-jade);
}

.priority--B {
  background: rgba(107, 164, 216, 0.14);
  color: var(--accent-blue);
}

.task-control {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.delete-chip {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid rgba(184, 92, 92, 0.28);
  border-radius: 50%;
  background: rgba(184, 92, 92, 0.12);
  color: #ffb9b9;
  font-size: 14px;
  line-height: 1;
}

.check-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: #0e151d;
  color: transparent;
  font-size: 0;
}

.check-button.is-done {
  border-color: var(--accent-jade);
  background: var(--accent-jade);
  color: #06231d;
}

.check-button.is-done::after {
  content: "";
  width: 10px;
  height: 6px;
  border-bottom: 2px solid currentColor;
  border-left: 2px solid currentColor;
  transform: rotate(-45deg) translate(1px, -1px);
}

.stepper {
  display: grid;
  grid-template-columns: 34px minmax(54px, auto) 34px;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-button);
  background: #0e151d;
}

.stepper button {
  height: 36px;
  background: transparent;
  color: var(--text-main);
  font-size: 18px;
}

.stepper span {
  min-width: 54px;
  color: var(--text-sub);
  text-align: center;
}

.resource-input {
  width: 96px;
  height: 36px;
  padding: 0 10px;
}

.resource-control {
  display: grid;
  grid-template-columns: 64px 38px;
  align-items: center;
  gap: 8px;
}

.resource-card {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.resource-card__top,
.resource-card__line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.resource-card__bottom {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: center;
  gap: 10px;
}

.resource-card h3 {
  margin: 0;
  font-size: 15px;
}

.resource-card__value {
  color: var(--text-main);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.resource-meter {
  overflow: hidden;
  height: 6px;
  border-radius: 999px;
  background: #0e151d;
}

.resource-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent-jade);
}

.status-danger .resource-meter span {
  background: var(--accent-red);
}

.status-warning .resource-meter span {
  background: var(--accent-gold);
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-sub);
  font-size: 11px;
}

.status-chip--danger {
  background: rgba(184, 92, 92, 0.16);
  color: #ffb9b9;
}

.status-chip--warning {
  background: rgba(214, 179, 106, 0.14);
  color: var(--accent-gold);
}

.weekly-group {
  display: grid;
  gap: 10px;
}

.weekly-group + .weekly-group {
  margin-top: 16px;
}

.event-card,
.character-card {
  display: grid;
  gap: 12px;
  padding: 15px;
}

.event-card {
  align-content: start;
  --event-thumb-size: 132px;
}

.event-card--with-image {
  grid-template-columns: var(--event-thumb-size) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "image head"
    "image desc"
    "image tasks";
  column-gap: 14px;
}

.event-card__image {
  display: block;
  width: var(--event-thumb-size);
  height: var(--event-thumb-size);
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius-card);
  background: #0e151d;
}

.event-card--with-image .event-card__image {
  grid-area: image;
}

.event-card--with-image:not(.news-card) .event-card__image {
  align-self: end;
}

.news-card.event-card--with-image {
  grid-template-rows: auto auto;
  grid-template-areas:
    "image head"
    "image desc";
}

.news-card--interactive {
  text-align: left;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.news-card--interactive:hover,
.news-card--interactive:focus-visible {
  border-color: rgba(79, 209, 176, 0.46);
  background: rgba(25, 36, 51, 0.92);
}

.news-card--interactive:focus-visible {
  outline: 3px solid rgba(79, 209, 176, 0.18);
  outline-offset: 2px;
}

.event-card--with-image .event-card__head,
.event-card--with-image .event-card__desc {
  grid-area: head;
}

.event-card--with-image .event-card__desc {
  grid-area: desc;
}

.event-card--with-image > .task-list {
  grid-area: tasks;
  align-self: end;
}

.event-card__head,
.character-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.event-card__head > div {
  min-width: 0;
}

.event-card h2,
.character-card h2 {
  margin: 0;
  font-size: 18px;
  overflow-wrap: break-word;
  word-break: keep-all;
}

.event-card__desc {
  margin: -2px 0 0;
  color: var(--text-sub);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: break-word;
  word-break: keep-all;
}

.event-card .task-list {
  gap: 8px;
}

.event-task {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-card);
  background: rgba(14, 21, 29, 0.54);
}

.event-task.is-done {
  border-color: rgba(79, 209, 176, 0.38);
  background: rgba(27, 55, 51, 0.38);
}

.event-task__title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.event-task__title strong {
  overflow-wrap: break-word;
  word-break: keep-all;
  line-height: 1.25;
}

.character-add-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-card);
  background: rgba(14, 21, 29, 0.72);
}

.character-add-form__input {
  height: 42px;
  padding: 0 12px;
  border-color: rgba(79, 209, 176, 0.18);
  background: rgba(11, 16, 22, 0.88);
}

.character-add-form__input::placeholder {
  color: var(--text-muted);
}

.character-add-form .btn {
  min-height: 42px;
  padding: 0 16px;
}

.character-list {
  gap: 10px;
  margin-top: 14px;
}

.character-list .character-card {
  position: relative;
  padding: 18px 12px 12px;
  background: rgba(20, 29, 39, 0.72);
}

.character-list .character-card.is-active {
  border-color: rgba(79, 209, 176, 0.58);
  background: rgba(27, 55, 51, 0.36);
}

.character-list .character-card.is-active::before {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 0;
  width: 3px;
  border-radius: 0 999px 999px 0;
  background: var(--accent-jade);
}

.character-list .character-card__head {
  align-items: center;
}

.character-list .character-card__head > div:first-child {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.character-list .character-card h2 {
  font-size: 16px;
  overflow-wrap: break-word;
  word-break: keep-all;
}

.character-list .panel__meta {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 12px;
}

.character-list .character-card__status {
  position: absolute;
  top: 8px;
  right: 10px;
  z-index: 1;
}

.character-list .action-row {
  flex: 0 0 auto;
  justify-content: flex-end;
  width: auto;
  gap: 6px;
}

.character-list .btn {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

.deadline {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  max-width: 100%;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(107, 164, 216, 0.14);
  color: var(--accent-blue);
  font-size: 12px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.setting-block {
  display: grid;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--line-soft);
}

.setting-block:first-child {
  border-top: 0;
  padding-top: 0;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  color: var(--text-sub);
  font-size: 13px;
}

.field input,
.field select {
  width: 100%;
  height: 38px;
  padding: 0 10px;
}

.hidden-task-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 10px;
}

.hidden-task-groups {
  display: grid;
  gap: 16px;
}

.hidden-task-section {
  display: grid;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}

.hidden-task-section:first-child {
  padding-top: 0;
  border-top: 0;
}

.hidden-task-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hidden-task-section__head h3 {
  margin: 0;
  font-size: 15px;
}

.toggle-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  min-height: 64px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-card);
  color: var(--text-sub);
}

.toggle-row input {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin-top: 3px;
}

.toggle-row .priority {
  flex: 0 0 auto;
}

.toggle-row__text {
  display: grid;
  gap: 2px;
  align-content: start;
  min-width: 0;
}

.toggle-row__text span,
.toggle-row__text small {
  overflow-wrap: break-word;
  word-break: keep-all;
}

.toggle-row__text small {
  color: var(--text-muted);
  font-size: 12px;
}

.empty {
  padding: 18px;
  border: 1px dashed var(--line-soft);
  border-radius: var(--radius-card);
  color: var(--text-muted);
  text-align: center;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10;
  max-width: min(380px, calc(100vw - 36px));
  padding: 12px 14px;
  border: 1px solid rgba(79, 209, 176, 0.4);
  border-radius: var(--radius-card);
  background: #101821;
  color: var(--text-main);
  box-shadow: var(--shadow-panel);
}

.notice-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4, 7, 11, 0.72);
  backdrop-filter: blur(10px);
}

.notice-dialog {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(760px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-card);
  background: #101821;
  box-shadow: var(--shadow-panel);
}

.notice-dialog__head {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 16px;
  border-bottom: 1px solid var(--line-soft);
}

.notice-dialog__head--no-image {
  grid-template-columns: minmax(0, 1fr) auto;
}

.notice-dialog__image {
  display: block;
  width: 104px;
  height: 104px;
  border-radius: var(--radius-card);
  object-fit: cover;
  background: #0e151d;
}

.notice-dialog__title {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.notice-dialog__title h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.28;
  overflow-wrap: break-word;
  word-break: keep-all;
}

.notice-dialog__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--text-sub);
  font-size: 13px;
}

.notice-dialog__close {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-button);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  font-size: 22px;
  line-height: 1;
}

.notice-dialog__close:hover,
.notice-dialog__close:focus-visible {
  border-color: rgba(79, 209, 176, 0.46);
  outline: none;
}

.notice-dialog__body {
  display: grid;
  gap: 0;
  align-content: start;
  min-height: 0;
  overflow: auto;
  padding: 16px;
}

.notice-dialog__body--sectioned {
  gap: 14px;
}

.notice-detail-section {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.notice-detail-section h3 {
  margin: 0;
  color: var(--accent-gold);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.25;
}

.notice-detail-section__lines {
  display: grid;
  gap: 0;
}

.notice-dialog__body p {
  margin: 0;
  color: var(--text-sub);
  font-size: 14px;
  line-height: 1.58;
  letter-spacing: 0;
  word-spacing: 0;
  overflow-wrap: break-word;
  word-break: normal;
}

.bottom-nav {
  display: none;
}

.mobile-brand {
  display: none;
}

@media (max-width: 1040px) {
  .page-head {
    display: grid;
    align-items: start;
    gap: 12px;
  }

  .action-row {
    justify-content: flex-start;
  }
}

@media (max-width: 1180px) {
  .grid--dashboard {
    grid-template-columns: 1fr;
  }

  .event-card {
    --event-thumb-size: 144px;
  }

  .news-card {
    --event-thumb-size: 116px;
  }

  .event-card--with-image:not(.news-card) {
    row-gap: 8px;
  }

  .task-card__desc {
    font-size: 11px;
    line-height: 1.3;
  }
}

@media (max-width: 1080px) {
  .grid--two {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  :root {
    --mobile-page-x: clamp(10px, 3.2vw, 14px);
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    display: none;
  }

  .main-area {
    min-height: 100vh;
  }

  .topbar {
    min-height: 78px;
    padding: 12px var(--mobile-page-x);
  }

  .mobile-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
  }

  .mobile-brand .brand__seal {
    flex-basis: 38px;
  }

  .mobile-brand strong {
    white-space: nowrap;
  }

  .topbar__left {
    flex: 1 1 auto;
  }

  .topbar__right {
    display: grid;
    gap: 6px;
    justify-items: end;
  }

  .time-chip {
    min-height: 38px;
    padding: 5px 8px;
  }

  .time-chip span {
    grid-template-columns: 54px 64px;
    gap: 6px;
    font-size: 11px;
  }

  .time-chip strong {
    font-size: 12px;
  }

  .character-select {
    width: clamp(112px, 28vw, 148px);
    height: 34px;
    padding-right: 30px;
    font-size: 13px;
  }

  .content {
    padding: 20px var(--mobile-page-x) 28px;
  }

  .app-footer {
    padding: 8px var(--mobile-page-x) calc(92px + env(safe-area-inset-bottom, 0px));
    font-size: 11px;
    line-height: 1.45;
  }

  .page-head {
    display: grid;
  }

  .grid--dashboard,
  .grid--two,
  .form-grid,
  .hidden-task-grid,
  .custom-task-form {
    grid-template-columns: 1fr;
  }

  .task-card {
    grid-template-columns: minmax(0, 1fr) minmax(98px, auto);
    gap: 10px;
    align-items: center;
  }

  .task-card__desc {
    display: -webkit-box;
    max-height: calc(1.3em * 2);
    overflow: hidden;
    font-size: 11px;
    line-height: 1.3;
    overflow-wrap: break-word;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .task-card__side {
    min-width: 98px;
  }

  .task-control {
    justify-content: flex-end;
    min-width: 0;
  }

  .event-card {
    --event-thumb-size: 144px;
  }

  .event-card--with-image {
    row-gap: 8px;
  }

  .event-card--with-image .event-card__head {
    align-self: start;
  }

  .event-card h2 {
    font-size: 17px;
    line-height: 1.22;
  }

  .event-card__desc {
    align-self: center;
    margin-top: 0;
    font-size: 12px;
    line-height: 1.36;
  }

  .event-card--with-image > .task-list {
    align-self: end;
  }

  .event-task {
    min-height: 44px;
    padding: 7px 9px;
  }

  .event-task__title {
    gap: 7px;
  }

  .event-task__title strong {
    font-size: 14px;
  }

  .bottom-nav {
    --bottom-nav-shift: 0px;
    position: fixed;
    right: 0;
    bottom: -1px;
    left: 0;
    z-index: 5;
    display: grid;
    grid-template-columns: repeat(7, 48px);
    justify-content: center;
    gap: 5px;
    width: 100%;
    padding: 7px var(--mobile-page-x) calc(7px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--line-soft);
    background: rgba(11, 16, 22, 0.97);
    backdrop-filter: blur(14px);
  }

  .bottom-nav::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: -32px;
    left: 0;
    height: 32px;
    background: rgba(11, 16, 22, 0.97);
  }

  .bottom-nav__item {
    position: relative;
    display: grid;
    min-width: 0;
    min-height: 52px;
    align-content: center;
    justify-self: center;
    justify-items: center;
    gap: 4px;
    width: 100%;
    padding: 6px 0 4px;
    border-radius: 0;
    background: transparent;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 650;
    line-height: 1.15;
    overflow-wrap: anywhere;
    transform: translateX(var(--bottom-nav-shift));
    white-space: normal;
  }

  .bottom-nav__item > span:last-child {
    display: block;
    width: 100%;
    text-align: center;
  }

  .bottom-nav__item:hover {
    background: transparent;
    color: var(--text-main);
  }

  .bottom-nav__item.is-active {
    background: transparent;
    color: var(--text-main);
  }

  .bottom-nav__item.is-active::before {
    display: none;
  }

  .bottom-nav__item .nav__glyph {
    position: relative;
    width: 25px;
    height: 25px;
    border-color: transparent;
    background: rgba(255, 255, 255, 0.04);
    color: var(--accent-gold);
    font-size: 12px;
    transition:
      background 160ms ease,
      color 160ms ease,
      border-color 160ms ease;
  }

  .bottom-nav__item.is-active .nav__glyph {
    border-color: rgba(79, 209, 176, 0.38);
    background: rgba(79, 209, 176, 0.16);
    color: var(--accent-jade);
  }

  .bottom-nav__item.is-active .nav__glyph::before {
    content: "";
    position: absolute;
    top: -9px;
    left: 50%;
    width: 22px;
    height: 3px;
    border-radius: 999px;
    background: var(--accent-jade);
    transform: translateX(-50%);
  }

  .toast {
    bottom: 78px;
  }

  .notice-modal {
    align-items: center;
    padding: 20px 12px calc(78px + env(safe-area-inset-bottom, 0px));
  }

  .notice-dialog {
    width: 100%;
    max-height: min(620px, calc(100vh - 112px - env(safe-area-inset-bottom, 0px)));
  }
}

@media (max-width: 640px) {
  .topbar {
    --mobile-tools-width: clamp(140px, 37vw, 164px);
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--mobile-tools-width);
    grid-template-areas:
      "brand tools"
      ". picker";
    align-items: center;
    gap: 12px;
  }

  .topbar__left,
  .topbar__right {
    min-width: 0;
  }

  .topbar__left {
    display: contents;
  }

  .topbar__right {
    grid-area: tools;
    display: flex;
    justify-content: flex-end;
  }

  .mobile-brand {
    grid-area: brand;
  }

  .character-select {
    grid-area: picker;
    justify-self: end;
    width: 100%;
    max-width: 100%;
  }

  .time-chip {
    width: 100%;
    min-width: 0;
  }

  .page-head,
  .section-title,
  .hidden-task-section__head {
    align-items: flex-start;
  }

  .page-head {
    gap: 12px;
  }

  .action-row {
    width: 100%;
  }

  .action-row .btn {
    flex: 1 1 auto;
  }

  .page-head p {
    font-size: 13px;
  }

}

@media (max-width: 480px) {
  .topbar {
    align-items: flex-start;
    gap: clamp(8px, 2.4vw, 12px);
  }

  .event-card {
    --event-thumb-size: clamp(92px, 23vw, 104px);
  }

  .event-card--with-image {
    column-gap: 10px;
    grid-template-rows: auto auto auto;
    grid-template-areas:
      "image head"
      "image desc"
      "tasks tasks";
  }

  .event-card--with-image:not(.news-card) .event-card__image {
    align-self: start;
  }

  .event-card--with-image > .task-list {
    align-self: stretch;
  }

  .page-head p {
    display: block;
  }

  .task-card__desc {
    font-size: 12px;
    line-height: 1.35;
  }

  .mobile-brand .brand__seal {
    flex-basis: 32px;
    width: 32px;
    height: 32px;
    font-size: 9px;
  }

  .resource-card__top,
  .resource-card__line,
  .event-card__head,
  .character-card__head {
    align-items: flex-start;
    flex-direction: column;
  }

  .resource-card__top,
  .resource-card__line {
    align-items: center;
    flex-direction: row;
  }

  .resource-card__bottom {
    gap: 8px;
  }

  .event-card__head {
    flex-direction: row;
    gap: 8px;
  }

  .event-card__head .deadline {
    min-height: 24px;
    padding: 0 8px;
    font-size: 11px;
    white-space: nowrap;
  }

  .panel,
  .task-card,
  .resource-card,
  .event-card,
  .character-card {
    padding: 12px;
  }

  .event-card {
    gap: 10px;
  }

  .event-card h2 {
    font-size: 16px;
  }

  .event-card__desc {
    font-size: 11px;
    line-height: 1.32;
  }

  .event-task {
    grid-template-columns: minmax(0, 1fr) 38px;
    gap: 8px;
  }

  .event-task__title strong {
    font-size: 13px;
  }

  .task-card {
    grid-template-columns: minmax(0, 1fr) minmax(94px, auto);
    gap: 8px;
  }

  .task-card__side {
    display: grid;
    gap: 6px;
    justify-items: end;
    min-width: 94px;
  }

  .task-control {
    align-items: center;
    justify-content: flex-end;
    flex-direction: row;
  }

  .resource-input {
    width: 54px;
    height: 34px;
    padding: 0 8px;
  }

  .resource-control {
    grid-template-columns: 54px 34px;
    gap: 6px;
  }

  .task-card__tag {
    width: auto;
    min-width: 0;
    max-width: 100%;
    min-height: 20px;
    padding: 0 7px;
    font-size: 11px;
  }

  .check-button,
  .delete-chip {
    width: 34px;
    height: 34px;
    align-self: flex-end;
  }

  .bottom-nav {
    --bottom-nav-shift: 0px;
    grid-template-columns: repeat(7, 43px);
    gap: 3px;
    padding: 7px var(--mobile-page-x) calc(7px + env(safe-area-inset-bottom, 0px));
  }

  .bottom-nav__item {
    min-height: 50px;
    font-size: 11px;
  }

  .bottom-nav__item .nav__glyph {
    width: 24px;
    height: 24px;
    font-size: 11px;
  }

  .notice-dialog__head {
    grid-template-columns: 72px minmax(0, 1fr) auto;
    gap: 10px;
    padding: 12px;
  }

  .notice-dialog {
    max-height: min(560px, calc(100vh - 104px - env(safe-area-inset-bottom, 0px)));
  }

  .notice-dialog__head--no-image {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .notice-dialog__image {
    width: 72px;
    height: 72px;
  }

  .notice-dialog__title h2 {
    font-size: 18px;
  }

  .notice-dialog__body {
    padding: 14px 12px 18px;
  }

  .notice-dialog__body p {
    font-size: 13px;
    line-height: 1.58;
  }
}

@media (max-width: 360px) {
  .event-card {
    --event-thumb-size: 88px;
  }

  .content {
    padding-right: var(--mobile-page-x);
    padding-left: var(--mobile-page-x);
  }

  .topbar {
    padding-right: var(--mobile-page-x);
    padding-left: var(--mobile-page-x);
  }

  .time-chip span {
    grid-template-columns: 48px 58px;
    gap: 4px;
  }

  .notice-modal {
    padding-top: 14px;
    padding-right: 10px;
    padding-left: 10px;
  }

  .character-select {
    padding-left: 10px;
    padding-right: 26px;
    font-size: 12px;
  }

  .task-card {
    grid-template-columns: minmax(0, 1fr) minmax(88px, auto);
  }

  .task-card__side {
    min-width: 88px;
  }

  .resource-input {
    width: 48px;
  }

  .resource-control {
    grid-template-columns: 48px 34px;
    gap: 5px;
  }

  .bottom-nav__item {
    font-size: 10px;
  }

  .bottom-nav {
    --bottom-nav-shift: 0px;
    grid-template-columns: repeat(7, 37px);
    gap: 2px;
  }

  .bottom-nav__item .nav__glyph {
    width: 23px;
    height: 23px;
  }
}
