
/* User diary */
.diary-page {
    --diary-surface: #090909;
    max-width: 1160px;
    min-height: 70vh;
    margin-top: 1.25rem;
}

.diary-loading {
    display: grid;
    min-height: 48vh;
    place-items: center;
    color: rgba(236, 234, 227, 0.5);
    font-size: 0.9rem;
}

.diary-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.45rem 0 1.15rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.diary-hero span {
    display: block;
    margin-bottom: 0.38rem;
    color: rgba(236, 234, 227, 0.46);
    font-size: 0.76rem;
    font-weight: 650;
    letter-spacing: 0.03em;
}

.diary-hero h1 {
    margin: 0;
    color: #f4f3ef;
    font-size: clamp(2.25rem, 7vw, 4.2rem);
    font-weight: 760;
    line-height: 0.92;
    letter-spacing: -0.075em;
}

.diary-hero > strong {
    color: rgba(244, 243, 239, 0.82);
    font-size: clamp(1rem, 3vw, 1.35rem);
    font-weight: 680;
    letter-spacing: -0.04em;
}

.diary-view-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.diary-view-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem;
    flex: 0 1 360px;
    width: 100%;
    max-width: 360px;
    margin: 1rem 0;
    padding: 0.26rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: #090909;
}

.diary-view-tabs button {
    min-height: 2.45rem;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: rgba(238, 236, 229, 0.48);
    font-size: 0.84rem;
    font-weight: 720;
    cursor: pointer;
}

.diary-view-tabs button[aria-selected="true"] {
    background: transparent !important;
    box-shadow: none !important;
    color: #f2f1ec;
}

.diary-panel,
.diary-share-start {
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 20px;
    background-color: var(--diary-surface) !important;
    background-image: none !important;
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.24);
    padding: 1rem;
}

.diary-panel-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.8rem;
    border: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: transparent !important;
    box-shadow: none !important;
}

.diary-panel-head h2 {
    display: flex;
    align-items: center;
    height: 2.45rem;
    margin: 0;
    color: #efeee9;
    font-size: 1.22rem;
    font-weight: 700;
    letter-spacing: -0.04em;
}

.diary-panel-head p {
    margin: 0.32rem 0 0;
    color: rgba(236, 234, 227, 0.43);
    font-size: 0.76rem;
}

.diary-element-form,
#diary-room-join-form {
    display: flex;
    gap: 0.4rem;
}

.diary-element-form input,
.diary-element-form button {
    box-sizing: border-box;
    height: 2.45rem;
}

.diary-element-form input,
#diary-room-join-form input,
.diary-room-composer > input {
    min-width: 0;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 9px;
    outline: none;
    background: #080808;
    color: #f1f0eb;
    padding: 0.62rem 0.72rem;
    font-size: 0.82rem;
}

.diary-element-form input:focus,
#diary-room-join-form input:focus,
.diary-room-composer > input:focus {
    border-color: rgba(255, 255, 255, 0.42);
}

.diary-element-form button,
#diary-room-join-form button,
.diary-share-actions > button,
.diary-primary-button,
.diary-owner-tools button,
.diary-room-topline button,
.diary-login-card button {
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 9px;
    background: #202020;
    color: #eeede8;
    padding: 0.62rem 0.78rem;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
}

.diary-element-form button:hover,
#diary-room-join-form button:hover,
.diary-share-actions > button:hover,
.diary-primary-button:hover,
.diary-owner-tools button:hover,
.diary-room-topline button:hover {
    border-color: rgba(255, 255, 255, 0.38);
    background: #2b2b2b;
}

.diary-table-wrap {
    overflow-x: auto;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    background: #070707;
    scrollbar-color: #4a4a4a #111;
}

.diary-table {
    width: 100%;
    min-width: max-content;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
}

.diary-table th,
.diary-table td {
    width: 136px;
    height: 58px;
    border-right: 1px solid rgba(255, 255, 255, 0.07);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    padding: 0.5rem;
    text-align: center;
}

.diary-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    height: 48px;
    background: #181818;
    color: rgba(244, 243, 239, 0.72);
    font-size: 0.78rem;
    font-weight: 700;
}

.diary-table th:first-child {
    position: sticky;
    left: 0;
    z-index: 3;
    width: 94px;
    min-width: 94px;
    background: #111;
}

.diary-table thead th:first-child {
    z-index: 4;
    background: #1b1b1b;
}

.diary-table tbody th strong,
.diary-table tbody th span {
    display: block;
}

.diary-table tbody th strong {
    color: rgba(244, 243, 239, 0.74);
    font-size: 0.8rem;
    font-weight: 700;
}

.diary-table tbody th span {
    margin-top: 0.15rem;
    color: rgba(244, 243, 239, 0.36);
    font-size: 0.63rem;
}

.diary-table tr:last-child th,
.diary-table tr:last-child td {
    border-bottom: 0;
}

.diary-table th:last-child,
.diary-table td:last-child {
    border-right: 0;
}

.diary-recorded {
    color: rgba(244, 243, 239, 0.68);
    font-size: 0.88rem;
    font-variant-numeric: tabular-nums;
}

.diary-missed {
    color: rgba(244, 243, 239, 0.2);
    font-size: 1.2rem;
    font-weight: 300;
}

.diary-unavailable {
    color: rgba(244, 243, 239, 0.12);
    font-size: 0.9rem;
}

.diary-table tr.is-today td,
.diary-table tr.is-today th {
    background-color: #161616;
}

.diary-table tr.is-today th:first-child {
    background-color: #1c1c1c;
}

.diary-lanes {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    overflow-x: auto;
    width: 100%;
    padding: 0.1rem 0 0.55rem;
    scroll-snap-type: x proximity;
    scrollbar-color: #4a4a4a #111;
}

.diary-lane {
    flex: 0 0 220px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 13px;
    background: #080808;
    scroll-snap-align: start;
}

.diary-lane > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    min-height: 48px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
    background: #191919;
    padding: 0.65rem 0.72rem;
}

.diary-lane > header strong {
    overflow: hidden;
    color: rgba(244, 243, 239, 0.84);
    font-size: 0.82rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.diary-lane-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 0.4rem;
}

.diary-lane-actions span {
    flex: 0 0 auto;
    color: rgba(244, 243, 239, 0.38);
    font-size: 0.66rem;
}

.diary-lane-actions button {
    border: 0;
    background: transparent;
    color: rgba(244, 243, 239, 0.32);
    padding: 0.15rem 0;
    font-size: 0.64rem;
    font-weight: 650;
    cursor: pointer;
}

.diary-lane-actions button:hover {
    color: rgba(244, 243, 239, 0.78);
}

.diary-lane-actions button:disabled {
    opacity: 0.35;
    cursor: wait;
}

.diary-lane.is-unavailable {
    opacity: 0.62;
}

.diary-shared-missing {
    display: grid;
    min-height: 82px;
    place-items: center;
    color: rgba(244, 243, 239, 0.34);
    padding: 0.9rem;
    font-size: 0.72rem;
    line-height: 1.55;
    text-align: center;
}

.diary-shared-members {
    display: grid;
    gap: 0.8rem;
}

.diary-shared-element-tabs {
    display: flex;
    gap: 0.42rem;
    overflow-x: auto;
    margin-bottom: 0.72rem;
    padding: 0.08rem 0 0.3rem;
    scrollbar-color: #4a4a4a #111;
}

.diary-shared-element-tabs button {
    flex: 0 0 auto;
    min-height: 2.3rem;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 999px;
    background: #111;
    color: rgba(244, 243, 239, 0.5);
    padding: 0.45rem 0.72rem;
    font-size: 0.75rem;
    font-weight: 680;
    white-space: nowrap;
    cursor: pointer;
}

.diary-shared-element-tabs button[aria-selected="true"] {
    border-color: #e7e7e3;
    background: #e7e7e3;
    color: #090909;
}

.diary-shared-table-section {
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 14px;
    background: #070707;
}

.diary-shared-table-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: 48px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.68rem 0.8rem;
}

.diary-shared-table-head strong {
    color: rgba(244, 243, 239, 0.86);
    font-size: 0.86rem;
    font-weight: 700;
}

.diary-label-toggle {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    padding: 2px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: #111;
}

.diary-label-toggle button {
    min-width: 42px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: rgba(244, 243, 239, 0.4);
    padding: 0.32rem 0.5rem;
    font-size: 0.68rem;
    font-weight: 650;
    cursor: pointer;
}

.diary-label-toggle button[aria-pressed="true"] {
    background: #e7e7e3;
    color: #090909;
}

.diary-shared-table th:first-child strong {
    white-space: nowrap;
}

.diary-shared-table-section .diary-table-wrap {
    border: 0;
    border-radius: 0;
}

.diary-shared-table {
    width: var(--diary-table-width);
    min-width: 100%;
    table-layout: fixed;
}

.diary-shared-table col.diary-day-column {
    width: 94px;
}

.diary-shared-table col.diary-member-column {
    width: 140px;
}

.diary-shared-table th,
.diary-shared-table td {
    width: 140px;
    min-width: 140px;
    max-width: 140px;
}

.diary-shared-table th:first-child,
.diary-shared-table td:first-child {
    width: 94px;
    min-width: 94px;
    max-width: 94px;
}

.diary-shared-table thead th strong,
.diary-shared-table thead th small {
    display: block;
}

.diary-shared-table thead th strong {
    overflow: hidden;
    max-width: 120px;
    margin: 0 auto;
    color: rgba(244, 243, 239, 0.76);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.diary-shared-table thead th small {
    margin-top: 0.12rem;
    color: rgba(244, 243, 239, 0.32);
    font-size: 0.6rem;
}

.diary-shared-table td.is-today {
    background: #161616;
}

.diary-shared-member {
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 14px;
    background: #070707;
    padding: 0.75rem;
}

.diary-shared-member-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.65rem;
    padding: 0 0.1rem 0.65rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.diary-shared-member-head strong {
    color: rgba(244, 243, 239, 0.88);
    font-size: 0.88rem;
    font-weight: 700;
}

.diary-shared-member-head span {
    color: rgba(244, 243, 239, 0.38);
    font-size: 0.66rem;
}

.diary-lane-row {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    align-items: center;
    gap: 0.45rem;
    min-height: 58px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    padding: 0.48rem 0.55rem;
}

.diary-lane-row:last-child {
    border-bottom: 0;
}

.diary-lane-row > span {
    color: rgba(244, 243, 239, 0.52);
    font-size: 0.72rem;
    font-weight: 680;
    text-align: left;
}

.diary-lane-row > span small {
    display: block;
    margin-top: 0.12rem;
    color: rgba(244, 243, 239, 0.28);
    font-size: 0.6rem;
    font-weight: 600;
}

.diary-lane-row > strong {
    overflow: hidden;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.diary-lane-row.is-today {
    background: #141414;
}

.diary-lane-row input,
.diary-today-cell input {
    width: 100%;
    min-width: 104px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    outline: none;
    background: #080808;
    color: #f4f3ef;
    padding: 0.58rem 0.45rem;
    font-size: 0.88rem;
    text-align: center;
    font-variant-numeric: tabular-nums;
    transition: border-color 0.15s, background-color 0.15s;
}

.diary-lane-row input:focus,
.diary-today-cell input:focus {
    border-color: rgba(255, 255, 255, 0.55);
    background: #101010;
}

.diary-lane-row input.is-saving,
.diary-today-cell input.is-saving {
    opacity: 0.5;
}

.diary-lane-row input.is-saved,
.diary-today-cell input.is-saved {
    border-color: rgba(255, 255, 255, 0.7);
    background: #202020;
}

.diary-lane-row input::-webkit-inner-spin-button,
.diary-lane-row input::-webkit-outer-spin-button,
.diary-today-cell input::-webkit-inner-spin-button,
.diary-today-cell input::-webkit-outer-spin-button {
    appearance: none;
    margin: 0;
}

.diary-lock-note {
    margin: 0.75rem 0 0;
    color: rgba(236, 234, 227, 0.36);
    font-size: 0.72rem;
    line-height: 1.5;
}

.diary-share-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.diary-room-composer {
    display: grid;
    gap: 0.85rem;
    max-width: 640px;
    margin-top: 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    background: #0c0c0c;
    padding: 0.9rem;
}

.diary-room-composer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.diary-room-composer-head strong,
.diary-owner-tools strong {
    color: rgba(244, 243, 239, 0.82);
    font-size: 0.84rem;
}

.diary-room-composer-head button {
    border: 0;
    background: transparent;
    color: rgba(244, 243, 239, 0.58);
    font-size: 1.15rem;
    cursor: pointer;
}

.diary-share-options > span {
    display: block;
    margin-bottom: 0.5rem;
    color: rgba(236, 234, 227, 0.44);
    font-size: 0.72rem;
}

.diary-share-options > div,
.diary-share-options.compact > div {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.diary-share-options small {
    color: rgba(236, 234, 227, 0.38);
    font-size: 0.74rem;
}

.diary-share-options label {
    position: relative;
    cursor: pointer;
}

.diary-share-options input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.diary-share-options label span {
    display: block;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 999px;
    background: #111;
    color: rgba(244, 243, 239, 0.48);
    padding: 0.4rem 0.62rem;
    font-size: 0.74rem;
}

.diary-share-options input:checked + span {
    border-color: #e7e7e3;
    background: #e7e7e3;
    color: #090909;
}

.diary-primary-button {
    justify-self: start;
}

.diary-room-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
    margin-top: 1rem;
}

.diary-room-item {
    display: grid;
    gap: 0.32rem;
    min-height: 118px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    background: #0b0b0b;
    padding: 0.85rem;
    text-align: left;
    cursor: pointer;
}

.diary-room-item:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background: #111;
}

.diary-room-item span,
.diary-room-item small {
    color: rgba(236, 234, 227, 0.38);
    font-size: 0.68rem;
}

.diary-room-item strong {
    align-self: end;
    color: rgba(244, 243, 239, 0.84);
    font-size: 0.96rem;
    font-weight: 680;
}

.diary-empty {
    grid-column: 1 / -1;
    padding: 2.7rem 1rem;
    color: rgba(236, 234, 227, 0.4);
    font-size: 0.82rem;
    text-align: center;
}

.diary-room-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    margin-bottom: 0.8rem;
}

.diary-room-topline > button:first-child {
    border-color: transparent;
    background: transparent;
    color: rgba(244, 243, 239, 0.5);
    padding-left: 0;
}

.diary-code-button strong {
    margin-left: 0.45rem;
    color: #fff;
    letter-spacing: 0.1em;
}

.diary-leave-button {
    color: rgba(244, 243, 239, 0.58) !important;
}

.diary-owner-tools {
    margin-top: 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 13px;
    background: #0a0a0a;
}

.diary-owner-tools summary {
    color: rgba(244, 243, 239, 0.56);
    padding: 0.8rem 0.9rem;
    font-size: 0.78rem;
    font-weight: 680;
    cursor: pointer;
}

.diary-owner-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.9rem;
}

.diary-owner-grid form {
    display: grid;
    align-content: start;
    gap: 0.7rem;
}

.diary-room-element-manager {
    display: grid;
    align-content: start;
    gap: 0.7rem;
}

.diary-room-element-add-form {
    display: flex !important;
    gap: 0.4rem !important;
}

.diary-room-element-add-form input {
    flex: 1;
    min-width: 0;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 9px;
    outline: none;
    background: #080808;
    color: #f1f0eb;
    padding: 0.62rem 0.72rem;
    font-size: 0.82rem;
}

.diary-room-element-add-form input:focus {
    border-color: rgba(255, 255, 255, 0.42);
}

.diary-room-element-add-form button:disabled {
    opacity: 0.45;
    cursor: wait;
}

.diary-room-element-manager #diary-room-elements-form {
    padding-top: 0.1rem;
}

.diary-owner-grid form > button {
    justify-self: start;
}

.diary-member-manager {
    display: grid;
    align-content: start;
    gap: 0.45rem;
}

.diary-member-manager > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 2.3rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    color: rgba(244, 243, 239, 0.62);
    font-size: 0.76rem;
}

.diary-member-manager button {
    border: 0;
    background: transparent;
    color: rgba(244, 243, 239, 0.4);
    padding: 0.35rem;
}

.diary-toast {
    position: fixed;
    z-index: 10000;
    right: 1rem;
    bottom: 1rem;
    max-width: min(360px, calc(100vw - 2rem));
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 11px;
    background: #e8e8e5;
    color: #0a0a0a;
    padding: 0.72rem 0.85rem;
    font-size: 0.78rem;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity 0.16s, transform 0.16s;
}

.diary-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.diary-toast[data-tone="error"] {
    border-color: #444;
    background: #171717;
    color: #f1f0eb;
}

.diary-login-card {
    display: grid;
    justify-items: start;
    max-width: 560px;
    margin: 4rem auto;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    background: #0b0b0b;
    padding: 1.4rem;
}

.diary-login-card > span {
    color: rgba(244, 243, 239, 0.38);
    font-size: 0.72rem;
}

.diary-login-card h1 {
    margin: 0.45rem 0 0;
    color: #f1f0eb;
    font-size: 1.5rem;
}

.diary-login-card p {
    color: rgba(244, 243, 239, 0.48);
    font-size: 0.84rem;
    line-height: 1.6;
}

.diary-login-card a {
    border-radius: 9px;
    background: #ededeb;
    color: #090909;
    padding: 0.65rem 0.82rem;
    font-size: 0.8rem;
    font-weight: 720;
    text-decoration: none;
}

@media (max-width: 760px) {
    .diary-page {
        width: 100%;
        margin-top: 0.55rem;
        padding: 0 0.75rem;
    }

    .diary-hero {
        padding-top: 1rem;
    }

    .diary-view-tabs {
        flex: 1 0 100%;
        width: 100%;
        max-width: none;
    }

    .diary-view-toolbar {
        gap: 0.5rem;
    }

    .diary-label-toggle button {
        min-width: 38px;
        padding-inline: 0.4rem;
    }

    .diary-label-toggle {
        margin-left: auto;
    }

    .diary-panel,
    .diary-share-start {
        border-radius: 16px;
        padding: 0.75rem;
    }

    .diary-panel-head {
        align-items: stretch;
        flex-direction: column;
    }

    .diary-element-form input {
        flex: 1;
    }

    .diary-table th,
    .diary-table td {
        width: 124px;
        height: 54px;
    }

    .diary-table th:first-child {
        width: 78px;
        min-width: 78px;
    }

    .diary-lane {
        flex-basis: min(72vw, 230px);
    }

    .diary-shared-element-tabs {
        margin-right: -0.75rem;
        padding-right: 0.75rem;
    }

    .diary-shared-table-head {
        padding: 0.62rem 0.7rem;
    }

    .diary-shared-table col.diary-day-column {
        width: 78px;
    }

    .diary-shared-table {
        width: var(--diary-mobile-table-width);
    }

    .diary-shared-table col.diary-member-column {
        width: 124px;
    }

    .diary-shared-table th,
    .diary-shared-table td {
        width: 124px;
        min-width: 124px;
        max-width: 124px;
    }

    .diary-shared-table th:first-child,
    .diary-shared-table td:first-child {
        width: 78px;
        min-width: 78px;
        max-width: 78px;
    }

    .diary-share-actions {
        align-items: stretch;
        flex-direction: column;
    }

    #diary-room-join-form input {
        flex: 1;
    }

    .diary-room-list {
        grid-template-columns: 1fr;
    }

    .diary-room-item {
        min-height: 94px;
    }

    .diary-owner-grid {
        grid-template-columns: 1fr;
    }

    .diary-code-button {
        overflow: hidden;
        max-width: 60%;
        text-overflow: ellipsis;
    }

    .diary-toast {
        right: 0.75rem;
        bottom: 0.75rem;
    }
}
