@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;600;700&family=IBM+Plex+Sans:wght@400;600&display=swap");

:root {
    --ink: #1f1c16;
    --muted: #6b6256;
    --panel: rgba(255, 255, 255, 0.82);
    --panel-border: rgba(25, 20, 10, 0.12);
    --shadow: 0 12px 30px rgba(27, 22, 12, 0.18);
    --accent: #c76a2d;
    --panel-solid: #fff8ef;
    --panel-soft: rgba(255, 255, 255, 0.7);
    --dialog-bg: #fbf7f1;
    --dialog-border: rgba(28, 22, 12, 0.18);
    --dialog-shadow: 0 32px 90px rgba(25, 18, 8, 0.28);
    --dialog-header: rgba(255, 255, 255, 0.82);
    --field-bg: #fff;
    --field-border: rgba(31, 24, 14, 0.2);
}

.minmap-app {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.55rem 0.85rem;
    background: var(--panel);
    border-bottom: 1px solid var(--panel-border);
    backdrop-filter: blur(6px);
    position: relative;
    z-index: 10;
    flex-wrap: wrap;
}

.toolbar-left,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.menu {
    position: relative;
}

.menu > summary {
    list-style: none;
}

.menu > summary::-webkit-details-marker {
    display: none;
}

.menu[open] > summary {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

.menu-panel {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    min-width: 180px;
    padding: 0.55rem;
    border-radius: 16px;
    border: 1px solid var(--dialog-border);
    background: var(--dialog-bg);
    box-shadow: var(--dialog-shadow);
    display: grid;
    gap: 0.4rem;
    z-index: 50;
}

.menu-item {
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: rgba(255, 255, 255, 0.86);
    padding: 0.45rem 0.7rem;
    border-radius: 12px;
    font-weight: 600;
    text-align: left;
    transition: transform 120ms ease, box-shadow 120ms ease;
}

.menu-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 18px rgba(25, 18, 8, 0.12);
}

.toolbar-right {
    margin-left: auto;
    justify-content: flex-end;
}

.btn {
    border: 1px solid var(--panel-border);
    background: #fff6ea;
    color: var(--ink);
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    font-weight: 600;
    transition: transform 120ms ease, box-shadow 120ms ease;
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.08);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

.btn.ghost {
    background: rgba(255, 255, 255, 0.55);
    color: var(--muted);
    border-style: dashed;
}

.hint {
    font-size: 0.85rem;
    color: var(--muted);
}

.status {
    font-size: 0.8rem;
    color: var(--muted);
    padding: 0.2rem 0.5rem;
    border: 1px dashed rgba(0, 0, 0, 0.1);
    border-radius: 999px;
}

.project-badge {
    font-size: 0.85rem;
    font-weight: 600;
    color: #5f4b36;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.status.pulse {
    animation: status-pulse 300ms ease;
}

@keyframes status-pulse {
    from { background: rgba(199, 106, 45, 0.2); }
    to { background: transparent; }
}

.minmap {
    position: relative;
    flex: 1;
    overflow: hidden;
    background: radial-gradient(circle at 20% 10%, #fff3de 0%, #f2ede4 45%, #ebe5dc 100%);
    z-index: 1;
}

.minmap::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(60, 52, 40, 0.12) 1px, transparent 1px);
    background-size: 32px 32px;
    opacity: 0.35;
    pointer-events: none;
}

.canvas-layer {
    position: absolute;
    inset: 0;
    z-index: 2;
}

.link-layer {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.link-layer path {
    stroke: rgba(64, 55, 40, 0.65);
    stroke-width: 2.2px;
    fill: none;
    stroke-linecap: round;
}

.link-layer path.shadow {
    stroke: rgba(0, 0, 0, 0.15);
    stroke-width: 6px;
}

.animate-in .card,
.animate-in .group {
    animation: lift-in 220ms ease both;
}

@keyframes lift-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.card {
    width: 220px;
    min-height: 120px;
    background: var(--card-color, #ffe6a7);
    border: 1px solid rgba(42, 36, 28, 0.2);
    border-radius: 14px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}

.card.canvas-card {
    position: absolute;
}

.card.list-card {
    width: 100%;
    height: 70px;
    min-height: 70px;
    overflow: hidden;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.5rem;
    background: rgba(255, 255, 255, 0.5);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 14px 14px 0 0;
    justify-content: space-between;
    overflow: hidden;
}

.card-text {
    flex: 1;
    padding: 0.4rem 0.5rem;
    border: 0;
    background: transparent;
    font-size: 0.75rem;
    min-height: 60px;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.35;
    max-height: calc(1.35em * 30);
    overflow: auto;
    scrollbar-gutter: stable;
}

.button-card {
    cursor: pointer;
    background: var(--card-color, #d6e4ff);
}

.table-card {
    cursor: pointer;
    background: var(--card-color, #d6ffe6);
}

.file-card {
    cursor: pointer;
    background: var(--card-color, #f3d9ff);
}

.calendar-card {
    cursor: pointer;
    background: var(--card-color, #ffe3b8);
}

.table-card-header .table-title {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex: 1;
    min-width: 0;
}

.table-card-header .table-icon {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8px;
    stroke-linecap: round;
    stroke-linejoin: round;
    color: rgba(40, 78, 54, 0.7);
    flex: 0 0 auto;
}

.table-card-header .table-title-text {
    font-weight: 700;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-card-header .file-title {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex: 1;
    min-width: 0;
}

.file-card-header .file-icon {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8px;
    stroke-linecap: round;
    stroke-linejoin: round;
    color: rgba(76, 52, 98, 0.72);
    flex: 0 0 auto;
}

.file-card-header .file-title-text {
    font-weight: 700;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-card-body {
    padding: 0.55rem 0.65rem;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.file-card-body .file-name {
    font-weight: 600;
    font-size: 0.92rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-card-body .file-meta {
    font-size: 0.78rem;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-card-header .calendar-title {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex: 1;
    min-width: 0;
}

.calendar-card-header .calendar-icon {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8px;
    stroke-linecap: round;
    stroke-linejoin: round;
    color: rgba(120, 77, 21, 0.74);
    flex: 0 0 auto;
}

.calendar-card-header .calendar-title-text {
    font-weight: 700;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-card-body {
    padding: 0.45rem 0.6rem 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.calendar-card-month {
    font-size: 0.84rem;
    font-weight: 700;
    color: rgba(120, 77, 21, 0.84);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-card-meta {
    font-size: 0.78rem;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.table-card-body {
    padding: 0.4rem 0.6rem 0.6rem;
    font-size: 0.85rem;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.table-card-meta {
    font-weight: 700;
    color: rgba(40, 78, 54, 0.85);
}

.button-card .button-title {
    font-weight: 700;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.button-card .button-body {
    padding: 0.4rem 0.6rem 0.6rem;
    font-size: 0.85rem;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.button-card .button-target {
    font-weight: 600;
    color: #4b5f7a;
}

.card.list-card .card-text {
    max-height: 100%;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.color-input {
    width: 22px;
    height: 22px;
    border: 0;
    padding: 0;
    background: transparent;
}

.edit-btn {
    margin-left: auto;
    border: 0;
    background: transparent;
    color: #6b4a2e;
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    cursor: pointer;
    flex: 0 0 auto;
}

.edit-btn:hover {
    background: rgba(0, 0, 0, 0.06);
}

.edit-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8px;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.group {
    position: absolute;
    width: 260px;
    background: var(--group-color, #dff2ff);
    border: 1px solid rgba(42, 36, 28, 0.2);
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.group-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.55rem;
    background: rgba(255, 255, 255, 0.55);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 16px 16px 0 0;
    justify-content: space-between;
    overflow: hidden;
}

.group-title {
    flex: 1;
    border: 0;
    background: transparent;
    font-weight: 600;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    user-select: none;
}

.group-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.5rem;
    max-height: 240px;
    overflow: auto;
}

.drop-target {
    outline: 2px dashed var(--accent);
    outline-offset: 2px;
}

.dragging {
    opacity: 0.85;
}

.node-selected {
    outline: 2px dashed var(--accent);
    outline-offset: 4px;
}

.link-mode .card,
.link-mode .group {
    cursor: crosshair;
}

.modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 20;
    padding: 6vh 4vw;
    align-items: center;
    justify-content: center;
}

.modal.modal-top {
    z-index: 40;
}

#auth-modal {
    z-index: 60;
}

.table-modal {
    padding: 0;
}

.table-panel {
    width: 100vw;
    height: 100vh;
    max-height: none;
    border-radius: 0;
}

.calendar-panel {
    width: min(96vw, 980px);
}

.table-header {
    gap: 0.8rem;
}

.calendar-header {
    gap: 0.8rem;
}

.table-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.calendar-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.calendar-month-label {
    min-width: 160px;
    text-align: center;
    font-weight: 700;
    color: #5f4b36;
}

.table-body {
    padding: 0.9rem 1rem 1rem;
    gap: 0.85rem;
}

.calendar-body {
    padding: 1rem 1.1rem 1.1rem;
    gap: 0.6rem;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.35rem;
}

.calendar-weekday {
    text-align: center;
    font-size: 0.8rem;
    color: var(--muted);
    font-weight: 700;
    padding: 0.3rem 0;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.35rem;
}

.calendar-day {
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: rgba(255, 255, 255, 0.72);
    border-radius: 12px;
    min-height: 88px;
    padding: 0.45rem 0.45rem 0.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
    text-align: left;
    transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.calendar-day:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(25, 18, 8, 0.14);
    border-color: rgba(0, 0, 0, 0.2);
}

.calendar-day.is-other-month {
    opacity: 0.55;
}

.calendar-day.has-note {
    border-color: var(--day-color, rgba(199, 106, 45, 0.45));
    background: rgba(255, 242, 222, 0.95);
}

.calendar-day-number {
    font-weight: 700;
    color: var(--ink);
}

.calendar-day-preview {
    font-size: 0.74rem;
    color: var(--muted);
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.calendar-day-panel {
    width: min(92vw, 760px);
}

.table-formula {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.table-cell-ref {
    min-width: 64px;
    text-align: center;
    font-weight: 700;
    color: var(--ink);
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: rgba(255, 255, 255, 0.75);
    padding: 0.55rem 0.6rem;
}

.table-formula-input {
    flex: 1;
    min-width: 0;
}

.sheet-wrap {
    flex: 1;
    overflow: auto;
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: rgba(255, 255, 255, 0.55);
    box-shadow: 0 10px 24px rgba(25, 18, 8, 0.08);
    position: relative;
}

.univer-host {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: none;
}

.table-modal.univer-active .table-formula {
    display: none;
}

.table-modal.univer-active #table-add-row,
.table-modal.univer-active #table-add-col {
    display: none;
}

.table-modal.univer-active .table-body {
    padding: 0;
    gap: 0;
}

.table-modal.univer-active .sheet-wrap {
    border-radius: 0;
    border: none;
    background: transparent;
    box-shadow: none;
    overflow: hidden;
}

.table-modal.univer-active .sheet {
    display: none;
}

.table-modal.univer-active .univer-host {
    display: block;
}

.sheet {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
    color: var(--ink);
}

.sheet th,
.sheet td {
    border: 1px solid rgba(0, 0, 0, 0.14);
}

.sheet th {
    background: rgba(255, 255, 255, 0.8);
    color: var(--muted);
    font-weight: 700;
    font-size: 0.85rem;
    text-align: center;
    padding: 0.35rem 0.45rem;
}

.sheet-col-header {
    position: sticky;
    top: 0;
    z-index: 2;
}

.sheet-row-header {
    position: sticky;
    left: 0;
    z-index: 3;
    background: rgba(255, 255, 255, 0.86);
}

.sheet-corner {
    position: sticky;
    top: 0;
    left: 0;
    z-index: 4;
    background: rgba(255, 255, 255, 0.92);
}

.sheet-td {
    padding: 0;
    background: rgba(255, 255, 255, 0.62);
}

.sheet-cell {
    width: 132px;
    padding: 0.35rem 0.45rem;
    border: 0;
    background: transparent;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--ink);
}

.sheet-cell:focus {
    outline: 2px solid rgba(199, 106, 45, 0.45);
    outline-offset: -2px;
    background: rgba(255, 255, 255, 0.96);
}

.table-size-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
}

.modal.open {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20, 16, 10, 0.55);
    backdrop-filter: blur(3px);
}

.modal-panel {
    position: relative;
    width: min(96vw, 900px);
    max-height: calc(100vh - 12vh);
    margin: 0;
    background: var(--dialog-bg);
    border-radius: 24px;
    border: 1px solid var(--dialog-border);
    box-shadow: var(--dialog-shadow);
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1;
}

.auth-panel {
    width: min(92vw, 720px);
}

.auth-body label {
    font-size: 0.85rem;
    color: var(--muted);
}

.auth-body input {
    padding: 0.5rem 0.6rem;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.15);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.auth-message {
    margin: 0;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.4;
}

.auth-error {
    display: none;
    color: #b6422c;
    font-weight: 600;
}

.auth-hint {
    font-size: 0.85rem;
    color: var(--muted);
    margin: 0;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.45rem 1rem;
    background: var(--dialog-header);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 2;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.2;
}

.modal-subtitle {
    margin-top: 0.1rem;
    font-size: 0.8rem;
    color: var(--muted);
}

.modal-title {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.modal-body {
    margin-top: 0;
    padding: 1.2rem 1.4rem 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    overflow: auto;
    flex: 1 1 auto;
    min-height: 0;
}

.projects-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex: 1 1 auto;
    min-height: 160px;
    overflow: auto;
}

.files-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex: 1 1 auto;
    min-height: 160px;
    overflow: auto;
}

.image-panel {
    width: min(96vw, 1280px);
}

.image-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
}

.image-zoom {
    flex: 1 1 260px;
    accent-color: rgba(199, 106, 45, 0.8);
}

.image-zoom-label {
    font-weight: 600;
    color: var(--muted);
    min-width: 58px;
    text-align: right;
}

.image-viewer {
    position: relative;
    border-radius: 14px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: rgba(255, 255, 255, 0.75);
    overflow: auto;
    min-height: 280px;
    max-height: 70vh;
    box-shadow: 0 10px 24px rgba(25, 18, 8, 0.08);
}

.image-viewer img {
    display: block;
    transform-origin: 0 0;
    max-width: none;
}

.image-placeholder {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--muted);
    pointer-events: none;
    text-align: center;
    padding: 1rem;
}

.file-thumb {
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: rgba(255, 255, 255, 0.6);
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(25, 18, 8, 0.08);
}

.file-thumb img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
}

.file-thumb .file-thumb-placeholder {
    padding: 0.65rem 0.7rem;
    color: var(--muted);
    text-align: center;
    font-size: 0.85rem;
}

.project-item {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
        "title actions"
        "meta actions";
    gap: 0.25rem 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: 14px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: #fff;
    box-shadow: 0 10px 24px rgba(25, 18, 8, 0.08);
}

.project-item .title {
    grid-area: title;
    font-weight: 600;
    font-size: 1rem;
}

.project-item .meta {
    grid-area: meta;
    font-size: 0.8rem;
    color: var(--muted);
}

.project-item .actions {
    grid-area: actions;
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.component-kind {
    align-self: flex-start;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b4a2e;
    padding: 0.05rem 0.4rem;
    border-radius: 999px;
    border: 1px dashed rgba(0, 0, 0, 0.18);
    background: rgba(255, 255, 255, 0.7);
}

.field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.field.is-hidden {
    display: none;
}

.field-label {
    font-size: 0.8rem;
    color: var(--muted);
    font-weight: 600;
}

.field-input {
    padding: 0.6rem 0.7rem;
    border-radius: 12px;
    border: 1px solid var(--field-border);
    background: var(--field-bg);
    font-family: inherit;
    transition: border-color 140ms ease, box-shadow 140ms ease;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.field-textarea {
    min-height: 140px;
    resize: vertical;
}

.component-panel .field-textarea {
    min-height: 360px;
    height: clamp(320px, 55vh, 720px);
    line-height: 1.5;
}

.color-picker {
    width: 56px;
    height: 28px;
    padding: 0.1rem;
}

.component-extra {
    border-radius: 12px;
    border: 1px dashed rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 0.6);
    padding: 0.55rem 0.65rem;
}

.component-extra-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 0.4rem;
}

.component-hint {
    margin: 0;
    color: var(--muted);
    font-size: 0.85rem;
}

.component-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
    padding-top: 0.2rem;
}

.btn.danger {
    background: #ffe8e4;
    color: #9a2f1c;
    border-color: rgba(182, 66, 44, 0.35);
}

.icon-btn {
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    cursor: pointer;
    border-radius: 10px;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.icon-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(25, 18, 8, 0.18);
    border-color: rgba(0, 0, 0, 0.2);
}

.project-create {
    display: grid;
    grid-template-columns: minmax(160px, 1fr) auto;
    gap: 0.6rem;
    padding-top: 0.8rem;
    border-top: 1px dashed rgba(0, 0, 0, 0.12);
}

.project-create input {
    flex: 1;
    padding: 0.45rem 0.6rem;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.15);
}

.file-input {
    display: none;
}

.file-dropzone {
    border-radius: 12px;
    border: 1px dashed rgba(0, 0, 0, 0.18);
    background: rgba(255, 255, 255, 0.55);
    padding: 0.9rem 0.85rem;
    text-align: center;
    color: var(--muted);
    cursor: pointer;
    transition: border-color 140ms ease, background 140ms ease;
}

.file-dropzone.is-dragover {
    border-color: rgba(199, 106, 45, 0.45);
    background: rgba(199, 106, 45, 0.12);
    color: rgba(60, 40, 18, 0.92);
}

.file-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.drag-ghost {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    opacity: 0.9;
}

.list-placeholder {
    height: 70px;
    border: 2px dashed rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.45);
}

.error-page {
    padding: 2rem;
}

@media (max-width: 900px) {
    .toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .toolbar-right {
        flex-wrap: wrap;
    }

    .modal-panel {
        max-height: 92vh;
        border-radius: 18px;
    }

    .modal {
        padding: 4vh 3vw;
    }

    .calendar-day {
        min-height: 74px;
    }

    .calendar-day-preview {
        -webkit-line-clamp: 2;
    }
}

@media (min-width: 720px) {
    .auth-body {
        display: grid;
        grid-template-columns: minmax(180px, 1fr) minmax(240px, 1.2fr);
        grid-template-areas:
            "info form"
            "hint form";
        gap: 1rem 1.4rem;
        align-items: start;
    }

    .auth-message {
        grid-area: info;
    }

    .auth-form {
        grid-area: form;
    }

    .auth-hint {
        grid-area: hint;
    }
}

@media (min-width: 960px) {
    .component-panel {
        width: min(96vw, 1080px);
    }

    .component-panel .modal-body {
        display: grid;
        grid-template-columns: minmax(140px, 180px) minmax(420px, 1fr);
        grid-template-areas:
            "title title"
            "meta text"
            "extra text"
            "actions actions";
        gap: 1rem 1.6rem;
        align-items: start;
    }

    #component-title-field {
        grid-area: title;
    }

    #component-text-field {
        grid-area: text;
    }

    #component-preview-field {
        grid-area: text;
    }

    #component-color-field {
        grid-area: meta;
    }

    #component-extra {
        grid-area: extra;
    }

    .component-actions {
        grid-area: actions;
    }
}

.component-image-viewer {
    position: relative;
    height: clamp(320px, 55vh, 720px);
    max-height: none;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-in;
}

.component-image-viewer img {
    transform: none !important;
    position: static;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.modal-panel input:focus-visible,
.modal-panel textarea:focus-visible,
.modal-panel button:focus-visible {
    outline: 2px solid rgba(199, 106, 45, 0.35);
    outline-offset: 1px;
}
